verdnatura-chat/app/containers/StatusBar.js

25 lines
673 B
JavaScript
Raw Permalink Normal View History

2019-03-12 16:23:06 +00:00
import React from 'react';
import { StatusBar as StatusBarRN } from 'react-native';
import PropTypes from 'prop-types';
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
const StatusBar = React.memo(({ theme, barStyle, backgroundColor }) => {
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
});
StatusBar.propTypes = {
theme: PropTypes.string,
barStyle: PropTypes.string,
backgroundColor: PropTypes.string
2019-03-12 16:23:06 +00:00
};
export default withTheme(StatusBar);