From 1a3d2fbc10c24867da6b35146c98960d72f4da8e Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Mon, 21 Mar 2022 16:10:11 -0300 Subject: [PATCH] Chore: StatusBar theme and style props (#3906) * chore: clean status bar and remove useless theme * mend * wip * remove unused props --- app/containers/StatusBar.tsx | 17 +++++++++++------ app/views/E2EEncryptionSecurityView.tsx | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/containers/StatusBar.tsx b/app/containers/StatusBar.tsx index 5ebaf230..e54eb46e 100644 --- a/app/containers/StatusBar.tsx +++ b/app/containers/StatusBar.tsx @@ -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 ; + return ; }); -export default withTheme(StatusBar); +export default StatusBar; diff --git a/app/views/E2EEncryptionSecurityView.tsx b/app/views/E2EEncryptionSecurityView.tsx index 34759043..5c7cbac0 100644 --- a/app/views/E2EEncryptionSecurityView.tsx +++ b/app/views/E2EEncryptionSecurityView.tsx @@ -164,7 +164,7 @@ class E2EEncryptionSecurityView extends React.Component - + {this.renderChangePassword()}