vaulterm/frontend/app/_layout.tsx

48 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-11-05 18:43:59 +07:00
import { useFonts } from "expo-font";
import { Stack } from "expo-router";
import * as SplashScreen from "expo-splash-screen";
2024-11-06 06:24:14 +00:00
import { StatusBar } from "expo-status-bar";
2024-11-05 18:43:59 +07:00
import { useEffect } from "react";
import "react-native-reanimated";
2024-11-08 18:24:08 +07:00
import Providers from "./_providers";
2024-11-05 18:43:59 +07:00
// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();
export default function RootLayout() {
const [loaded] = useFonts({
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
});
useEffect(() => {
if (loaded) {
SplashScreen.hideAsync();
}
}, [loaded]);
if (!loaded) {
return null;
}
return (
2024-11-08 18:24:08 +07:00
<Providers>
2024-11-09 18:57:36 +00:00
<Stack
screenOptions={{
headerShadowVisible: false,
}}
>
2024-11-08 18:53:30 +00:00
<Stack.Screen
name="index"
2024-11-09 18:57:36 +00:00
options={{
headerShown: false,
title: "Loading...",
}}
2024-11-08 18:53:30 +00:00
/>
<Stack.Screen name="(drawer)" options={{ headerShown: false }} />
<Stack.Screen name="+not-found" options={{ title: "Not Found" }} />
2024-11-05 18:43:59 +07:00
</Stack>
2024-11-06 06:24:14 +00:00
<StatusBar style="auto" />
2024-11-08 18:24:08 +07:00
</Providers>
2024-11-05 18:43:59 +07:00
);
}