verdnatura-chat/app/containers/StatusBar.tsx

24 lines
615 B
TypeScript
Raw Normal View History

2019-03-12 16:23:06 +00:00
import React from 'react';
import { StatusBar as StatusBarRN } from 'react-native';
2019-12-04 16:39:53 +00:00
import { themes } from '../constants/colors';
import { withTheme } from '../theme';
2019-03-12 16:23:06 +00:00
interface IStatusBar {
theme: string;
barStyle: any;
backgroundColor: string;
}
const StatusBar = React.memo(({ theme, barStyle, backgroundColor }: IStatusBar) => {
if (!barStyle) {
barStyle = 'light-content';
if (theme === 'light') {
barStyle = 'dark-content';
}
2019-03-12 16:23:06 +00:00
}
return <StatusBarRN backgroundColor={backgroundColor ?? themes[theme].headerBackground} barStyle={barStyle} animated />;
2019-03-12 16:23:06 +00:00
});
export default withTheme(StatusBar);