@@ -5,6 +5,7 @@ import useUIModeStore from '../store/uiModeStore';
55import { themeChange } from 'theme-change' ;
66import { useTranslation } from 'react-i18next' ;
77import { StatusBar , Style } from '@capacitor/status-bar' ;
8+ import { AndroidEdgeToEdgeSupport } from '@capawesome/capacitor-android-edge-to-edge-support' ;
89
910export const Route = createRootRoute ( {
1011 component : RootComponent ,
@@ -29,13 +30,18 @@ function isDarkTheme(theme: string) {
2930async function applyStatusBarForTheme ( theme : string ) {
3031 const dark = isDarkTheme ( theme ) ;
3132
32- if ( dark ) {
33- await StatusBar . setBackgroundColor ( { color : '#020617' } ) ;
34- await StatusBar . setStyle ( { style : Style . Light } ) ;
35- } else {
36- await StatusBar . setBackgroundColor ( { color : '#f9fafb' } ) ;
37- await StatusBar . setStyle ( { style : Style . Dark } ) ;
38- }
33+ const darkColor = '#020617' ;
34+ const lightColor = '#f9fafb' ;
35+
36+ await AndroidEdgeToEdgeSupport . enable ( ) ;
37+
38+ await AndroidEdgeToEdgeSupport . setBackgroundColor ( {
39+ color : dark ? darkColor : lightColor ,
40+ } ) ;
41+
42+ await StatusBar . setStyle ( {
43+ style : dark ? Style . Light : Style . Dark ,
44+ } ) ;
3945
4046 await StatusBar . setOverlaysWebView ( { overlay : false } ) ;
4147}
0 commit comments