-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
40 lines (32 loc) · 921 Bytes
/
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
import React, { useState } from "react";
import Router from "./app/components/router/Router";
import * as Font from 'expo-font';
import AppLoading from 'expo-app-loading';
// * CONTEXT IMPORT
import { AuthContextProvider } from "./app/context/AuthContext";
import { GroupContextProvider } from "./app/context/GroupContext";
// * COMPONENTS IMPORT
// * STYLES IMPORT
const getFonts = () => Font.loadAsync({
"Syne-Regular":require('./app/assets/fonts/Syne-Regular.otf')
})
export default function App() {
const [fontsLoaded, setFontsLoaded] = useState(false);
if(fontsLoaded){
return (
<AuthContextProvider>
<GroupContextProvider>
<Router/>
</GroupContextProvider>
</AuthContextProvider>
)
} else {
return(
<AppLoading
startAsync={getFonts}
onFinish={()=>setFontsLoaded(true)}
onError={console.warn}
/>
)
}
};