-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_layout.tsx
More file actions
38 lines (36 loc) · 1.1 KB
/
_layout.tsx
File metadata and controls
38 lines (36 loc) · 1.1 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
38
import { ThemeProvider } from "@react-navigation/native";
import { Stack } from "expo-router";
import { StatusBar } from "expo-status-bar";
import { useColorScheme } from "nativewind";
import { Suspense } from "react";
import { ActivityIndicator, View } from "react-native";
import { AuthProvider } from "@/shared/auth/provider";
import { DbProvider } from "@/shared/db/provider";
import { NAV_THEME } from "@/shared/lib/theme";
import "@/shared/global.css";
import "../../i18n";
export default function RootLayout() {
const { colorScheme } = useColorScheme();
const theme = NAV_THEME[colorScheme ?? "light"];
return (
<ThemeProvider value={theme}>
<StatusBar style={theme.dark ? "light" : "dark"} />
<Suspense
fallback={
<View className="flex-1 justify-center items-center">
<ActivityIndicator size="large" />
</View>
}
>
<DbProvider>
<AuthProvider>
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="(auth)" />
<Stack.Screen name="(main)" />
</Stack>
</AuthProvider>
</DbProvider>
</Suspense>
</ThemeProvider>
);
}