verdnatura-chat/app/containers/StatusBar.js

26 lines
682 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';
import { isIOS } from '../utils/deviceInfo';
2019-03-29 19:36:07 +00:00
import { HEADER_BACKGROUND, COLOR_WHITE } from '../constants/colors';
2019-03-12 16:23:06 +00:00
const HEADER_BAR_STYLE = isIOS ? 'dark-content' : 'light-content';
const StatusBar = React.memo(({ light }) => {
if (light) {
2019-03-29 19:36:07 +00:00
return <StatusBarRN backgroundColor={COLOR_WHITE} barStyle='dark-content' animated />;
2019-03-12 16:23:06 +00:00
}
return <StatusBarRN backgroundColor={HEADER_BACKGROUND} barStyle={HEADER_BAR_STYLE} animated />;
});
StatusBar.propTypes = {
light: PropTypes.bool
};
StatusBar.defaultProps = {
light: false
};
export default StatusBar;