Chore: StatusBar theme and style props (#3906)
* chore: clean status bar and remove useless theme * mend * wip * remove unused props
This commit is contained in:
parent
8a12924904
commit
1a3d2fbc10
|
@ -2,22 +2,27 @@ import React from 'react';
|
|||
import { StatusBar as StatusBarRN } from 'react-native';
|
||||
|
||||
import { themes } from '../constants/colors';
|
||||
import { withTheme } from '../theme';
|
||||
import { useTheme } from '../theme';
|
||||
|
||||
const supportedStyles = {
|
||||
'light-content': 'light-content',
|
||||
'dark-content': 'dark-content'
|
||||
};
|
||||
|
||||
interface IStatusBar {
|
||||
theme?: string;
|
||||
barStyle?: any;
|
||||
barStyle?: keyof typeof supportedStyles;
|
||||
backgroundColor?: string;
|
||||
}
|
||||
|
||||
const StatusBar = React.memo(({ theme, barStyle, backgroundColor }: IStatusBar) => {
|
||||
const StatusBar = React.memo(({ barStyle, backgroundColor }: IStatusBar) => {
|
||||
const { theme } = useTheme();
|
||||
if (!barStyle) {
|
||||
barStyle = 'light-content';
|
||||
if (theme === 'light') {
|
||||
barStyle = 'dark-content';
|
||||
}
|
||||
}
|
||||
return <StatusBarRN backgroundColor={backgroundColor ?? themes[theme!].headerBackground} barStyle={barStyle} animated />;
|
||||
return <StatusBarRN backgroundColor={backgroundColor ?? themes[theme].headerBackground} barStyle={barStyle} animated />;
|
||||
});
|
||||
|
||||
export default withTheme(StatusBar);
|
||||
export default StatusBar;
|
||||
|
|
|
@ -164,7 +164,7 @@ class E2EEncryptionSecurityView extends React.Component<IE2EEncryptionSecurityVi
|
|||
const { theme } = this.props;
|
||||
return (
|
||||
<SafeAreaView testID='e2e-encryption-security-view' style={{ backgroundColor: themes[theme].backgroundColor }}>
|
||||
<StatusBar theme={theme} />
|
||||
<StatusBar />
|
||||
<List.Container>
|
||||
<View style={styles.container}>
|
||||
{this.renderChangePassword()}
|
||||
|
|
Loading…
Reference in New Issue