From 0c8b2f565e45652d0d39265228956badbdcea515 Mon Sep 17 00:00:00 2001
From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com>
Date: Mon, 14 Aug 2023 15:11:45 -0300
Subject: [PATCH] regression: attachment view is changing the color of status
bar (#5167)
---
app/containers/StatusBar.tsx | 27 +++++++++------------------
1 file changed, 9 insertions(+), 18 deletions(-)
diff --git a/app/containers/StatusBar.tsx b/app/containers/StatusBar.tsx
index dd7cf143f..996603a87 100644
--- a/app/containers/StatusBar.tsx
+++ b/app/containers/StatusBar.tsx
@@ -1,8 +1,7 @@
-import React, { useEffect } from 'react';
+import React from 'react';
import { StatusBar as StatusBarRN } from 'react-native';
import { useTheme } from '../theme';
-import { isAndroid } from '../lib/methods/helpers';
const supportedStyles = {
'light-content': 'light-content',
@@ -14,23 +13,15 @@ interface IStatusBar {
backgroundColor?: string;
}
-const StatusBar = React.memo(({ barStyle, backgroundColor }: IStatusBar) => {
+const StatusBar = ({ barStyle, backgroundColor }: IStatusBar) => {
const { theme, colors } = useTheme();
-
- useEffect(() => {
- if (!barStyle) {
- barStyle = 'light-content';
- if (theme === 'light') {
- barStyle = 'dark-content';
- }
+ if (!barStyle) {
+ barStyle = 'light-content';
+ if (theme === 'light') {
+ barStyle = 'dark-content';
}
- if (isAndroid) {
- StatusBarRN.setBackgroundColor(backgroundColor ?? colors.headerBackground);
- }
- StatusBarRN.setBarStyle(barStyle, true);
- }, [theme, barStyle, backgroundColor]);
-
- return ;
-});
+ }
+ return ;
+};
export default StatusBar;