vaulterm/frontend/app/_layout.tsx

36 lines
827 B
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-05 18:43:59 +07:00
<Stack>
<Stack.Screen name="+not-found" />
</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
);
}