30 lines
819 B
JavaScript
Executable File
30 lines
819 B
JavaScript
Executable File
import React, { Component } from 'react';
|
|
import {
|
|
StyleSheet,
|
|
View,
|
|
StatusBar,
|
|
Platform,
|
|
} from 'react-native';
|
|
import { ifIphoneX } from 'react-native-iphone-x-helper'
|
|
import { scale, verticalScale, moderateScale } from "react-native-size-matters";
|
|
const MyStatusBar = ({backgroundColor, ...props}) => (
|
|
<View style={[styles.statusBar, { backgroundColor }]}>
|
|
<StatusBar translucent backgroundColor={backgroundColor} {...props} />
|
|
</View>
|
|
)
|
|
|
|
|
|
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ?verticalScale(10) : StatusBar.height;
|
|
const APPBAR_HEIGHT = Platform.OS === 'ios' ? verticalScale(44) : verticalScale(56);
|
|
const styles = StyleSheet.create({
|
|
statusBar: {
|
|
...ifIphoneX({
|
|
height:0,
|
|
},
|
|
{
|
|
height:15,
|
|
})
|
|
},
|
|
})
|
|
|
|
export default MyStatusBar; |