react-native#StatusBar JavaScript Examples
The following examples show how to use
react-native#StatusBar.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js From bluezone-app with GNU General Public License v3.0 | 6 votes |
render() {
const {intl} = this.props;
const {formatMessage} = intl;
return (
<SafeAreaView style={styles.container}>
<StatusBar hidden={true} />
<ScrollView>
<View style={styles.containerLogo}>
<IconBTT height={LOGO_HEIGHT} width={LOGO_HEIGHT} />
<View style={styles.borderLogo} />
<IconBYT height={LOGO_HEIGHT} width={LOGO_HEIGHT} />
</View>
<View style={styles.body}>
<View style={styles.viewDep}>
<Text style={styles.description}>
{formatMessage(message.description)}
</Text>
<MediumText style={styles.title}>
{formatMessage(message.title)}
</MediumText>
</View>
</View>
</ScrollView>
<View style={styles.boxButton}>
<Text style={styles.button} onPress={this.onContinue}>
{formatMessage(message.button)}
</Text>
</View>
</SafeAreaView>
);
}
Example #2
Source File: statusbar.js From filen-mobile with GNU Affero General Public License v3.0 | 6 votes |
setStatusBarStyle = (darkMode) => {
if(Platform.OS == "android"){
StatusBar.setBackgroundColor(darkMode ? "black" : "white")
changeNavigationBarColor(darkMode ? "black" : "white", darkMode ? false : true, false)
}
StatusBar.setBarStyle(darkMode ? "light-content" : "dark-content")
}
Example #3
Source File: App.js From SemanaOmnistack10 with MIT License | 6 votes |
export default function App() {
return (
<>
<StatusBar
barStyle="light-content"
backgroundColor="#7D40E7"
/>
<Routes/>
</>
);
}
Example #4
Source File: status-bar.js From haven with MIT License | 6 votes |
export default function (props) {
const { backgroundColor } = props;
if (Platform.OS === 'ios') {
return (
<View style={{ height: iOSStatusBarHeight, backgroundColor }}>
<StatusBar {...props} />
</View>
);
} else {
return (
<View style={{ backgroundColor }}>
<StatusBar {...props} />
</View>
);
}
}
Example #5
Source File: status.rn.jsx From taro-form with MIT License | 6 votes |
render() {
// 状态栏文字颜色
const barStyle = verifyValueInArray(this.props.barStyle, ['light-content', 'dark-content', 'default'], 'light-content')
return <StatusBar
animated
hidden={false}
backgroundColor='transparent'
translucent
barStyle={barStyle}
/>
}
Example #6
Source File: App.js From atendimento-e-agilidade-medica-AAMed with MIT License | 6 votes |
export default function App() {
return (
<NavigationContainer>
<StoreProvider>
<StatusBar backgroundColor="#004b8b" translucent />
<Router />
</StoreProvider>
</NavigationContainer>
);
}
Example #7
Source File: history.js From turkce-sozluk with MIT License | 6 votes |
function HistoryView() {
useFocusEffect(
React.useCallback(() => {
StatusBar.setBarStyle('dark-content')
}, [])
)
return (
<Box as={SafeAreaView} flex={1}>
<Text>Arama Geçmişi</Text>
</Box>
)
}
Example #8
Source File: Main.js From adyen-react-native-online-payments with MIT License | 6 votes |
export default function Main() {
const isLoadingComplete = useCachedResources();
if (!isLoadingComplete) {
return null;
} else {
return (
<Provider store={store}>
<View style={styles.container}>
{Platform.OS === "ios" && <StatusBar barStyle="dark-content" />}
<NavigationContainer linking={LinkingConfiguration}>
<Stack.Navigator>
<Stack.Screen name="Root" component={BottomTabNavigator} />
<Stack.Screen name="Component" component={ComponentScreen} />
<Stack.Screen name="Card" component={CardScreen} />
<Stack.Screen name="IDeal" component={IDealScreen} />
<Stack.Screen name="Result" component={ResultScreen} />
</Stack.Navigator>
</NavigationContainer>
</View>
</Provider>
);
}
}
Example #9
Source File: Screen.js From MoviesDaily with MIT License | 6 votes |
Screen = ({ children }) => {
return (
<View style={{ flex: 1, backgroundColor: white }}>
<Container>
<StatusBar barStyle="dark-content" translucent />
{children}
</Container>
</View>
);
}
Example #10
Source File: menu-header.js From React-Native-Boilerplate with MIT License | 6 votes |
function MenuHeader(props) {
return (
<View style={styles.container}>
<StatusBar barStyle="dark-content" backgroundColor={'white'} />
<TouchableOpacity onPress={() => props.navigation.toggleDrawer()}>
<MaterialIcons name="menu" size={22} color="white" />
</TouchableOpacity>
<Text style={[textStyle.heading, { color: 'white' }]}>{props.title}</Text>
<View />
</View>
);
}
Example #11
Source File: App.js From expo-soundcloud-clone with MIT License | 6 votes |
export default function App(props) {
const [isLoadingComplete, setLoadingComplete] = useState(false);
if (!isLoadingComplete && !props.skipLoadingScreen) {
return (
<AppLoading
startAsync={loadResourcesAsync}
onError={handleLoadingError}
onFinish={() => handleFinishLoading(setLoadingComplete)}
/>
);
} else {
return (
<View style={styles.container}>
{Platform.OS === "ios" && <StatusBar barStyle="default" />}
<AppNavigator />
</View>
);
}
}
Example #12
Source File: index.js From english-course with MIT License | 6 votes |
export default function DissertativeLesson() {
const navigation = useNavigation();
return (
<Styled.SafeAreaContainer>
<Styled.Container>
<StatusBar barStyle="light-content" />
<Styled.BackButtonContainer onPress={() => navigation.goBack()}>
<Styled.BackButtonIcon name="chevron-left" />
</Styled.BackButtonContainer>
<Styled.Title>Tell me more about you!</Styled.Title>
<Styled.ContentContainer>
<Styled.Input placeholder="Here you can write anything you want!" />
</Styled.ContentContainer>
<Styled.ButtonContainer
onPress={() => navigation.navigate('translate-lesson')}
>
<Styled.ButtonText>Próximo</Styled.ButtonText>
</Styled.ButtonContainer>
</Styled.Container>
</Styled.SafeAreaContainer>
);
}
Example #13
Source File: Container.js From react-native-covid19 with MIT License | 6 votes |
export default function Container(props) {
const activeTheme = useContext(theme).globalTheme
const darkTheme = useContext(theme).darkTheme
return (
<>
<StatusBar backgroundColor={activeTheme.backgroundColor} barStyle={activeTheme.darkTheme ? "light-content" : "dark-content"} />
<ScrollView style={[styles.container, { backgroundColor: activeTheme.backgroundColor }]} contentContainerStyle={{ flexGrow: 1 }}>
{props.children}
</ScrollView>
</>
)
}
Example #14
Source File: App.js From designcode-app with MIT License | 6 votes |
export default function App() {
return (
<ApolloProvider client={client}>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Navigator />
</PersistGate>
</Provider>
<StatusBar barStyle="dark-content" />
</ApolloProvider>
);
}
Example #15
Source File: App.js From geometry_3d with MIT License | 6 votes |
export default function App() {
console.disableYellowBox = true;
return (
<Provider store={globalStorage.store}>
<PersistGate
persistor={globalStorage.persistor}
loading={<Spinner visible={true} />}
>
<StatusBar style="dark" translucent={true} />
<View
style={{
flex: 1,
marginTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
}}
>
<AppNavigator />
</View>
<Toast ref={(ref) => Toast.setRef(ref)} />
</PersistGate>
</Provider>
);
}
Example #16
Source File: DetailFollower.Screen.js From react-native-hook-template with MIT License | 6 votes |
DetailFollowerScreen = () => {
const navigation = useNavigation();
const renderToolbar = () => {
return (
<View style={styles.toolbar}>
<StatusBar
hidden={false}
backgroundColor={colors.primary}
barStyle={barStyle.lightContent}
/>
<TouchableOpacity
style={styles.viewWrapIcLeft}
onPress={() => navigation.goBack()}>
<MaterialCommunityIcons
name={'arrow-left'}
size={30}
color={colors.white}
/>
</TouchableOpacity>
<View style={styles.viewWrapTitleToolbar}>
<Text style={styles.titleToolbar}>Detail follower</Text>
</View>
<View style={styles.viewWrapIcRight} />
</View>
);
};
return (
<View style={styles.mainContainer}>
{renderToolbar()}
<Text style={styles.textContent}>
Example this is the detail follower screen
</Text>
</View>
);
}
Example #17
Source File: ProfileScreen.js From hero with MIT License | 6 votes |
ProfileScreen = () => {
return (
<SafeAreaView style={styles.appContainer}>
<StatusBar
translucent
backgroundColor="transparent"
barStyle="dark-content"
/>
<View style={styles.header}>
<Text style={styles.appTitle}>profile</Text>
</View>
<View style={styles.footer}>
<Text style={styles.p}>Designed by Gino Lee Swanepoel</Text>
<Text style={styles.p}>in React Native</Text>
</View>
</SafeAreaView>
);
}
Example #18
Source File: CustomScreenContainer.js From react-native-otp-login with MIT License | 6 votes |
CustomScreenContainer = props => {
const {children} = props;
return (
<>
<StatusBar barStyle="light-content" />
<SafeAreaView style={GenericStyles.whiteBackgroundContainer}>
{children}
</SafeAreaView>
</>
);
}
Example #19
Source File: index.js From puente-reactnative-collect with MIT License | 6 votes |
MainNavigation = () => {
const { container } = styles;
return (
<View style={container}>
{Platform.OS === 'ios' && <StatusBar />}
<NavigationContainer linking={LinkingConfiguration} independent>
<Stack.Navigator>
<Stack.Screen name="Sign In" component={SignIn} options={{ headerShown: false }} />
<Stack.Screen name="Sign Up" component={SignUp} options={{ headerShown: false }} />
<Stack.Screen name="GetPincode" component={GetPinCode} options={{ headerShown: true }} />
<Stack.Screen name="StorePincode" component={StorePinCode} options={{ headerShown: true }} />
<Stack.Screen
name="Root"
component={BottomTabNavigator}
options={{ headerShown: false, gestureEnabled: false }}
/>
</Stack.Navigator>
</NavigationContainer>
</View>
);
}
Example #20
Source File: Loading.js From ultimate-hackathon-starting-guide with MIT License | 6 votes |
export default function Loading() {
return (
<>
<StatusBar barStyle='dark-content' />
<SafeAreaView style={{flex : 1, backgroundColor: "#00FF00", alignItems: 'center', justifyContent: "center"}}>
<Text>loading lol</Text>
</SafeAreaView>
</>
);
}
Example #21
Source File: Router.js From mobile with GNU General Public License v3.0 | 6 votes |
function Router() {
useEffect(() => {
SplashScreen.hide();
});
return (
<NavigationContainer>
{Platform.OS === 'ios' ? (
<View style={styles.iosContainerStyle}>
<StatusBar
translucent
backgroundColor="#1d9b54"
barStyle="light-content"
/>
</View>
) : (
<StatusBar backgroundColor="#1d9b54" barStyle="light-content" />
)}
<Stack.Navigator headerMode="none">
<Stack.Screen name="Tabs" component={Tabs} />
<Stack.Screen name="Post" component={Post} />
<Stack.Screen name="SearchResults" component={SearchResults} />
</Stack.Navigator>
</NavigationContainer>
);
}
Example #22
Source File: App.js From hugin-mobile with GNU Affero General Public License v3.0 | 6 votes |
render() {
const loadedComponent = <AppContainer screenProps={this.state.screenProps}/>;
const notLoadedComponent = <View></View>;
return(
<View style={{ flex: 1, backgroundColor: this.state.screenProps.theme.backgroundColour}}>
<StatusBar />
{this.state.loaded ? loadedComponent : notLoadedComponent}
</View>
);
}
Example #23
Source File: Home.js From rn-animation with MIT License | 6 votes |
render() {
return (
<View style={styles.container}>
<StatusBar barStyle={'light-content'} />
<SafeAreaView style={{backgroundColor: Colors.accent.general}} />
<Header
title={'React Native Animation'}
isColor={true}
isLeft={false}
/>
<FlatList data={listAnimation} renderItem={this._renderItem} />
</View>
);
}
Example #24
Source File: index.js From react-native-vlc with MIT License | 6 votes |
componentDidMount() {
StatusBar.setBarStyle("light-content");
const { style } = this.props;
if (style && style.height && !isNaN(style.height)) {
this.initialHeight = style.height;
}
if (style && style.width && !isNaN(style.width)) {
this.initialWidth = style.width;
}
this.setState({
currentVideoAspectRatio: this.initialWidth + ":" + this.initialHeight,
});
}
Example #25
Source File: App.js From curso-react-native with MIT License | 6 votes |
App = () => (
<>
<StatusBar
barStyle="light-content"
backgroundColor={MyTheme.colors.primary}
/>
<NavigationContainer theme={MyTheme}>
<Stack.Navigator
screenOptions={{
headerStyle: {
backgroundColor: MyTheme.colors.primary,
},
headerTintColor: '#fff',
}}>
<Stack.Screen name="Pokédex" component={List} />
<Stack.Screen name="Pokémon" component={Detail} />
</Stack.Navigator>
</NavigationContainer>
</>
)
Example #26
Source File: App.js From react-native-ultimate-config with MIT License | 6 votes |
App: () => Node = () => {
const isDarkMode = useColorScheme() === 'dark';
const backgroundStyle = {
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
};
return (
<SafeAreaView style={backgroundStyle}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>
<Header />
<View
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}>
<Text>{Config.HELLO}</Text>
</View>
</ScrollView>
</SafeAreaView>
);
}
Example #27
Source File: App.js From real-frontend with GNU General Public License v3.0 | 6 votes |
App = () => (
<Provider store={store}>
<AuthProvider>
{({ initialRouteName, theme }) => (
<PaperProvider theme={theme}>
<StatusBar barStyle={theme.dark ? 'light-content' : 'dark-content'} />
<AppNavigator
initialRouteName={initialRouteName}
screenProps={{
theme,
}}
/>
</PaperProvider>
)}
</AuthProvider>
</Provider>
)
Example #28
Source File: App.js From mcrn-event-booking-app-starter with MIT License | 6 votes |
export default function App() {
const [assetsLoaded, setAssetLoaded] = useState(false);
/* Loading custom fonts in async */
const _loadAssetsAsync = async () => {
await Font.loadAsync(customFonts);
setAssetLoaded(true);
};
useEffect(() => {
_loadAssetsAsync();
});
return assetsLoaded ? (
<NavigationContainer>
<StatusBar barStyle="light-content"></StatusBar>
<Stack.Navigator
screenOptions={{
headerShown: false,
}}
initialRouteName="Featured"
>
<Stack.Screen name="Featured" component={Tabs} />
<Stack.Screen name="EventDetail" component={EventDetail} />
</Stack.Navigator>
</NavigationContainer>
) : (
<ActivityIndicator size="small"></ActivityIndicator>
);
}
Example #29
Source File: index.jsx From polaris with Apache License 2.0 | 6 votes |
View404 = () => {
const { t } = useTranslation()
const currentRoute = usePlatformLocation()
const path = currentRoute ? currentRoute.path : ''
return (
<Container>
<StatusBar style="auto" />
<Text>{t('errors:404', { path: path ? `${path} ` : '' })}</Text>
</Container>
)
}