Unverified Commit 1a3d2fbc authored by Gleidson Daniel Silva's avatar Gleidson Daniel Silva Committed by GitHub
Browse files

Chore: StatusBar theme and style props (#3906)

* chore: clean status bar and remove useless theme

* mend

* wip

* remove unused props
parent 8a129249
......@@ -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()}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment