File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 11import { useIsFocused } from '@react-navigation/native' ;
22import { useColorScheme } from 'nativewind' ;
3- import React from 'react' ;
4- import { StatusBar } from 'react-native' ;
3+ import { SystemBars } from 'react-native-edge-to-edge' ;
54
6- type Props = React . ComponentProps < typeof StatusBar > ;
7- export const FocusAwareStatusBar = ( props : Props ) => {
5+ type Props = { hidden ?: boolean } ;
6+ export const FocusAwareStatusBar = ( { hidden = false } : Props ) => {
87 const isFocused = useIsFocused ( ) ;
98 const { colorScheme } = useColorScheme ( ) ;
10- const isDark = colorScheme === 'dark' ;
11- const barStyle = isDark ? 'light-content' : 'dark-content' ;
129
13- return isFocused ? < StatusBar barStyle = { barStyle } { ... props } /> : null ;
10+ return isFocused ? < SystemBars style = { colorScheme } hidden = { hidden } /> : null ;
1411} ;
You can’t perform that action at this time.
0 commit comments