-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.js
More file actions
45 lines (38 loc) · 1.31 KB
/
App.js
File metadata and controls
45 lines (38 loc) · 1.31 KB
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
35
36
37
38
39
40
41
42
43
44
45
import React, { useEffect, useState } from 'react';
import AuthContextProvider from './provider/AuthProvider';
import { NavigationContainer } from '@react-navigation/native';
import { LogBox } from "react-native";
import * as Font from "expo-font";
import RootStack from './screens/RootStack';
import { loadData } from './database/loadData';
import Loading from './components/Loading';
LogBox.ignoreAllLogs();
export default function App() {
const [isLoaded, setIsLoaded] = useState(false);
const loadFonts = async () => {
await Font.loadAsync({
"Poppins-Normal": require("./assets/fonts/Poppins-Regular.ttf"),
"Poppins-Bold": require("./assets/fonts/Poppins-Bold.ttf"),
"Poppins-Thin": require("./assets/fonts/Poppins-Thin.ttf"),
"Poppins-SemiBold": require("./assets/fonts/Poppins-SemiBold.ttf")
});
setIsLoaded(true);
};
useEffect(() => { // Load default fonts
loadData();
loadFonts();
}, [])
return (
isLoaded
? (
<AuthContextProvider>
<NavigationContainer>
<RootStack />
</NavigationContainer>
</AuthContextProvider>
)
: (
<Loading />
)
);
}