2019-03-12 16:23:06 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { StatusBar as StatusBarRN } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import { isIOS } from '../utils/deviceInfo';
|
2019-12-11 23:01:12 +00:00
|
|
|
import { themes } from '../constants/colors';
|
|
|
|
import { withTheme } from '../theme';
|
2019-03-12 16:23:06 +00:00
|
|
|
|
2019-12-11 23:01:12 +00:00
|
|
|
const StatusBar = React.memo(({ theme }) => {
|
|
|
|
let barStyle = 'light-content';
|
|
|
|
if (theme === 'light' && isIOS) {
|
|
|
|
barStyle = 'dark-content';
|
2019-03-12 16:23:06 +00:00
|
|
|
}
|
2019-12-11 23:01:12 +00:00
|
|
|
return <StatusBarRN backgroundColor={themes[theme].headerBackground} barStyle={barStyle} animated />;
|
2019-03-12 16:23:06 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
StatusBar.propTypes = {
|
2019-12-11 23:01:12 +00:00
|
|
|
theme: PropTypes.string
|
2019-03-12 16:23:06 +00:00
|
|
|
};
|
|
|
|
|
2019-12-11 23:01:12 +00:00
|
|
|
export default withTheme(StatusBar);
|