-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.js
50 lines (44 loc) · 1.61 KB
/
App.js
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
46
47
48
49
50
import React, { useEffect, useState } from 'react';
import AuthProvider from './context/AuthContext';
import { NavigationContainer } from '@react-navigation/native';
import { LogBox } from "react-native";
import * as Font from "expo-font";
import RootStack from './screens/RootStack';
import CourseStack from './screens/course/CourseStack';
import Loading from './components/Loading';
import HomeStack from './screens/home/HomeStack';
import CourseOptions from './screens/home/components/CourseOptions';
import HomeScreen from './screens/home/HomeScreen';
import CourseHome from './screens/course/CourseHome';
import Lesson from './screens/course/Lesson';
import { loadData } from "./database/loadData"
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
loadFonts();
loadData();
}, [])
return (
isLoaded
? (
<AuthProvider>
<NavigationContainer>
<RootStack />
</NavigationContainer>
</AuthProvider>
)
: (
<Loading />
)
);
}