chore: conditional to setBackgroundColor only for Android (#5147)

This commit is contained in:
Reinaldo Neto 2023-07-25 10:21:55 -03:00 committed by GitHub
parent 15ec8c121d
commit 9ee26916b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import React, { useEffect } 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',
@ -23,7 +24,9 @@ const StatusBar = React.memo(({ barStyle, backgroundColor }: IStatusBar) => {
barStyle = 'dark-content';
}
}
if (isAndroid) {
StatusBarRN.setBackgroundColor(backgroundColor ?? colors.headerBackground);
}
StatusBarRN.setBarStyle(barStyle, true);
}, [theme, barStyle, backgroundColor]);