Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions app/containers/StatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion app/views/E2EEncryptionSecurityView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
Expand Down