-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathApp.tsx
34 lines (32 loc) · 1008 Bytes
/
App.tsx
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 { NavigationContainer } from "@react-navigation/native";
import StackNavigator from "./app/screens";
import { useFonts } from "expo-font";
import * as SplashScreen from "expo-splash-screen";
import { useEffect } from "react";
import { AuthProvider } from "./app/hooks/useAuth";
SplashScreen.preventAutoHideAsync();
export default function App() {
const [fontsLoaded] = useFonts({
"Os_Condensed-medium": require("./assets/fonts/OpenSans_Condensed-Medium.ttf"),
"Os_Condensed-regular": require("./assets/fonts/OpenSans_Condensed-Regular.ttf"),
"Os_Condensed-semi_bold": require("./assets/fonts/OpenSans_Condensed-SemiBold.ttf"),
});
useEffect(() => {
async function loadFont() {
if (fontsLoaded) {
await SplashScreen.hideAsync();
}
}
loadFont();
}, [fontsLoaded]);
if (!fontsLoaded) {
return null;
}
return (
<AuthProvider>
<NavigationContainer>
<StackNavigator />
</NavigationContainer>
</AuthProvider>
);
}