Make broadcast picker required in iOS only

This commit is contained in:
Tiago Jacobs 2022-02-13 12:36:03 -03:00
parent a751360632
commit 8985ea02d9
4 changed files with 27 additions and 21 deletions

12
App.js
View File

@ -8,7 +8,7 @@
import React from 'react';
import type {Node} from 'react';
import BroadcastPicker from './react/BroadcastPicker';
import Header from './react/Header';
import {
SafeAreaView,
@ -20,13 +20,7 @@ import {
View,
} from 'react-native';
import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
import {Colors, DebugInstructions} from 'react-native/Libraries/NewAppScreen';
const Section = ({children, title}): Node => {
const isDarkMode = useColorScheme() === 'dark';
@ -63,7 +57,7 @@ const App: () => Node = () => {
return (
<>
<BroadcastPicker/>
<Header />
<SafeAreaView style={backgroundStyle}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<ScrollView

View File

@ -1,12 +0,0 @@
import React from 'react';
import SystemBroadcastPicker from './ios-native-components/BBBN_SystemBroadcastPicker';
const BroadcastPicker = ({children, title}): Node => {
return (
<SystemBroadcastPicker
style={{marginTop: 50, height: 50, widht: 50, backgroundColor: '#EEE'}}
/>
);
};
export default BroadcastPicker;

24
react/Header.js Normal file
View File

@ -0,0 +1,24 @@
import React from 'react';
import SystemBroadcastPicker from './ios/native-components/BBBN_SystemBroadcastPicker';
import {Platform, StyleSheet} from 'react-native';
const styles = StyleSheet.create({
broacastPicker: {
...Platform.select({
ios: {
marginTop: 50,
height: 50,
widht: 50,
backgroundColor: '#EEE',
},
}),
},
});
const Header = ({children, title}): Node => {
return Platform.select({
ios: <SystemBroadcastPicker style={styles.broacastPicker} />,
});
};
export default Header;