mirror of
https://github.com/khairul169/vaulterm.git
synced 2025-04-28 16:49:39 +07:00
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
import { useFonts } from "expo-font";
|
|
import { Stack } from "expo-router";
|
|
import * as SplashScreen from "expo-splash-screen";
|
|
import { StatusBar } from "expo-status-bar";
|
|
import { useEffect } from "react";
|
|
import "react-native-reanimated";
|
|
import Providers from "./_providers";
|
|
|
|
// 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 (
|
|
<Providers>
|
|
<Stack
|
|
screenOptions={{
|
|
headerShadowVisible: false,
|
|
}}
|
|
>
|
|
<Stack.Screen
|
|
name="index"
|
|
options={{
|
|
headerShown: false,
|
|
title: "Loading...",
|
|
}}
|
|
/>
|
|
<Stack.Screen name="(drawer)" options={{ headerShown: false }} />
|
|
<Stack.Screen name="+not-found" options={{ title: "Not Found" }} />
|
|
</Stack>
|
|
<StatusBar style="auto" />
|
|
</Providers>
|
|
);
|
|
}
|