Skip to content

Commit 644d051

Browse files
hamzamekkasdolo
authored andcommitted
feat: replace statu bar with edge to edge systembar in focuseawarestatubar file
1 parent 9297d35 commit 644d051

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { useIsFocused } from '@react-navigation/native';
22
import { 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
};

0 commit comments

Comments
 (0)