regression: attachment view is changing the color of status bar (#5167)
This commit is contained in:
parent
b23df26d42
commit
0c8b2f565e
|
@ -1,8 +1,7 @@
|
||||||
import React, { useEffect } from 'react';
|
import React from 'react';
|
||||||
import { StatusBar as StatusBarRN } from 'react-native';
|
import { StatusBar as StatusBarRN } from 'react-native';
|
||||||
|
|
||||||
import { useTheme } from '../theme';
|
import { useTheme } from '../theme';
|
||||||
import { isAndroid } from '../lib/methods/helpers';
|
|
||||||
|
|
||||||
const supportedStyles = {
|
const supportedStyles = {
|
||||||
'light-content': 'light-content',
|
'light-content': 'light-content',
|
||||||
|
@ -14,23 +13,15 @@ interface IStatusBar {
|
||||||
backgroundColor?: string;
|
backgroundColor?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const StatusBar = React.memo(({ barStyle, backgroundColor }: IStatusBar) => {
|
const StatusBar = ({ barStyle, backgroundColor }: IStatusBar) => {
|
||||||
const { theme, colors } = useTheme();
|
const { theme, colors } = useTheme();
|
||||||
|
if (!barStyle) {
|
||||||
useEffect(() => {
|
barStyle = 'light-content';
|
||||||
if (!barStyle) {
|
if (theme === 'light') {
|
||||||
barStyle = 'light-content';
|
barStyle = 'dark-content';
|
||||||
if (theme === 'light') {
|
|
||||||
barStyle = 'dark-content';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isAndroid) {
|
}
|
||||||
StatusBarRN.setBackgroundColor(backgroundColor ?? colors.headerBackground);
|
return <StatusBarRN backgroundColor={backgroundColor ?? colors.headerBackground} barStyle={barStyle} animated />;
|
||||||
}
|
};
|
||||||
StatusBarRN.setBarStyle(barStyle, true);
|
|
||||||
}, [theme, barStyle, backgroundColor]);
|
|
||||||
|
|
||||||
return <StatusBarRN />;
|
|
||||||
});
|
|
||||||
|
|
||||||
export default StatusBar;
|
export default StatusBar;
|
||||||
|
|
Loading…
Reference in New Issue