forked from Ding-Payments/ding-payments
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_layout.tsx
More file actions
37 lines (34 loc) · 1.47 KB
/
Copy path_layout.tsx
File metadata and controls
37 lines (34 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { DarkTheme, DefaultTheme, Stack, ThemeProvider } from 'expo-router';
import { useColorScheme } from 'react-native';
import { AnimatedSplashOverlay } from '@/components/animated-icon';
import { ErrorBoundary } from '@/components/ErrorBoundary';
import { AuthProvider } from '@/features/auth/hooks/useAuth';
import { SessionPolicyMount } from '@/features/auth/components/SessionPolicyMount';
import { ReceivePaymentProvider } from '@/features/receive/hooks/useReceivePayment';
export default function RootLayout() {
const colorScheme = useColorScheme();
return (
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
<ErrorBoundary>
<AuthProvider>
<SessionPolicyMount />
<AnimatedSplashOverlay />
{/*
ReceivePaymentProvider wraps every route so the FSM orchestrator
(CLI-065) survives navigation between (tabs)/receive and the
receive/* screens — Expo Router unmounts/remounts screens on
navigation, so a per-screen hook instance would lose state.
*/}
<ReceivePaymentProvider>
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" />
<Stack.Screen name="(tabs)" />
<Stack.Screen name="(onboarding)" />
<Stack.Screen name="c05" />
</Stack>
</ReceivePaymentProvider>
</AuthProvider>
</ErrorBoundary>
</ThemeProvider>
);
}