Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/**
* On Android we setup the status bar in native code.
*/
import type CustomStatusBarType from './types';

export default function CustomStatusBar() {
// eslint-disable-next-line react/function-component-definition
const CustomStatusBar: CustomStatusBarType = () =>
// Prefer to not render the StatusBar component in Android as it can cause
// issues with edge to edge display. We setup the status bar appearance in
// MainActivity.java and styles.xml.
return null;
}
null;

CustomStatusBar.displayName = 'CustomStatusBar';

export default CustomStatusBar;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React, {useEffect} from 'react';
import Navigation, {navigationRef} from '@libs/Navigation/Navigation';
import StatusBar from '@libs/StatusBar';
import useTheme from '@styles/themes/useTheme';
import type CustomStatusBarType from './types';

function CustomStatusBar() {
// eslint-disable-next-line react/function-component-definition
const CustomStatusBar: CustomStatusBarType = () => {
const theme = useTheme();
useEffect(() => {
Navigation.isNavigationReady().then(() => {
Expand All @@ -20,7 +22,7 @@ function CustomStatusBar() {
});
}, [theme.PAGE_BACKGROUND_COLORS, theme.appBG]);
return <StatusBar />;
}
};

CustomStatusBar.displayName = 'CustomStatusBar';

Expand Down
6 changes: 6 additions & 0 deletions src/components/CustomStatusBar/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type CustomStatusBar = {
(): React.ReactNode;
displayName: string;
};

export default CustomStatusBar;