@@ -2,11 +2,11 @@ import { BlurTargetView } from "expo-blur";
22import * as Linking from "expo-linking" ;
33import * as SplashScreen from "expo-splash-screen" ;
44import { useEffect } from "react" ;
5- import { StatusBar , useColorScheme } from "react-native" ;
5+ import { StatusBar } from "react-native" ;
66import { GestureHandlerRootView } from "react-native-gesture-handler" ;
77import { KeyboardProvider } from "react-native-keyboard-controller" ;
88import { SafeAreaProvider } from "react-native-safe-area-context" ;
9- import { createStaticNavigation , DarkTheme , DefaultTheme } from "@react-navigation/native" ;
9+ import { createStaticNavigation } from "@react-navigation/native" ;
1010
1111import { RegistryContext } from "@effect/atom-react" ;
1212import { ConfirmDialogHost } from "./components/ConfirmDialogHost" ;
@@ -22,6 +22,7 @@ import { appAtomRegistry } from "./state/atom-registry";
2222import { OverlayPortalHost } from "./components/OverlayPortal" ;
2323import { appBlurTargetRef } from "./lib/appBlurTarget" ;
2424import { useThemeColor } from "./lib/useThemeColor" ;
25+ import { useMobileNavigationTheme } from "./lib/useMobileNavigationTheme" ;
2526
2627import "../global.css" ;
2728
@@ -58,45 +59,51 @@ function SplashScreenCoordinator() {
5859}
5960
6061export default function App ( ) {
61- const colorScheme = useColorScheme ( ) ;
62- const statusBarBg = useThemeColor ( "--color-status-bar" ) ;
63-
6462 return (
6563 < RegistryContext . Provider value = { appAtomRegistry } >
6664 < CloudAuthProvider >
6765 < AppearancePreferencesProvider >
68- < SplashScreenCoordinator />
69- < GestureHandlerRootView className = "flex-1" >
70- < KeyboardProvider statusBarTranslucent >
71- < SafeAreaProvider >
72- < StatusBar
73- barStyle = { colorScheme === "dark" ? "light-content" : "dark-content" }
74- backgroundColor = { statusBarBg }
75- translucent
76- />
77- { /* The navigation theme drives the NATIVE header appearance: native-stack
78- forwards `dark` as the nav bar's overrideUserInterfaceStyle. Without
79- this, React Navigation defaults to its light theme and every native
80- header (glass buttons, title, materials) is forced light even when
81- the system is in dark mode. */ }
82- { /* Blur target for Android dropdown backdrops — see appBlurTarget.ts. */ }
83- < BlurTargetView ref = { appBlurTargetRef } style = { { flex : 1 } } >
84- < IncomingShareProvider >
85- < Navigation
86- linking = { appLinking }
87- theme = { colorScheme === "dark" ? DarkTheme : DefaultTheme }
88- />
89- </ IncomingShareProvider >
90- < ConfirmDialogHost />
91- </ BlurTargetView >
92- { /* Anchored-menu overlays render here — in-window, so the
93- keyboard stays up while a dropdown is open. */ }
94- < OverlayPortalHost />
95- </ SafeAreaProvider >
96- </ KeyboardProvider >
97- </ GestureHandlerRootView >
66+ < AppContent />
9867 </ AppearancePreferencesProvider >
9968 </ CloudAuthProvider >
10069 </ RegistryContext . Provider >
10170 ) ;
10271}
72+
73+ function AppContent ( ) {
74+ const { themeAppearance } = useAppearancePreferences ( ) ;
75+ const statusBarBg = useThemeColor ( "--color-status-bar" ) ;
76+ const navigationTheme = useMobileNavigationTheme ( themeAppearance ) ;
77+
78+ return (
79+ < >
80+ < SplashScreenCoordinator />
81+ < GestureHandlerRootView className = "flex-1" >
82+ < KeyboardProvider statusBarTranslucent >
83+ < SafeAreaProvider >
84+ < StatusBar
85+ barStyle = { themeAppearance === "dark" ? "light-content" : "dark-content" }
86+ backgroundColor = { statusBarBg }
87+ translucent
88+ />
89+ { /* The navigation theme drives the NATIVE header appearance: native-stack
90+ forwards `dark` as the nav bar's overrideUserInterfaceStyle. Without
91+ this, React Navigation defaults to its light theme and every native
92+ header (glass buttons, title, materials) is forced light even when
93+ the system is in dark mode. */ }
94+ { /* Blur target for Android dropdown backdrops — see appBlurTarget.ts. */ }
95+ < BlurTargetView ref = { appBlurTargetRef } style = { { flex : 1 } } >
96+ < IncomingShareProvider >
97+ < Navigation linking = { appLinking } theme = { navigationTheme } />
98+ </ IncomingShareProvider >
99+ < ConfirmDialogHost />
100+ </ BlurTargetView >
101+ { /* Anchored-menu overlays render here — in-window, so the
102+ keyboard stays up while a dropdown is open. */ }
103+ < OverlayPortalHost />
104+ </ SafeAreaProvider >
105+ </ KeyboardProvider >
106+ </ GestureHandlerRootView >
107+ </ >
108+ ) ;
109+ }
0 commit comments