-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_layout.tsx
More file actions
34 lines (29 loc) · 992 Bytes
/
_layout.tsx
File metadata and controls
34 lines (29 loc) · 992 Bytes
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
import { useEffect } from "react";
import { SplashScreen, Stack } from "expo-router";
import { useFonts } from "expo-font";
import { UserProvider } from "@/context/user-provider";
import { UserInactivityProvider } from "@/context/user-inactivity";
SplashScreen.preventAutoHideAsync();
export default function TabLayout() {
const [fontsLoaded, error] = useFonts({
"DM Sans": require("../assets/fonts/DMSans_18pt-Medium.ttf"),
});
useEffect(() => {
if (error) throw error;
if (fontsLoaded) SplashScreen.hideAsync();
}, [fontsLoaded, error]);
if (!fontsLoaded && !error) return null;
return (
<UserInactivityProvider>
<UserProvider>
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen
name="(modals)/inactive"
options={{ headerShown: false }}
/>
</Stack>
</UserProvider>
</UserInactivityProvider>
);
}