-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
44 lines (39 loc) · 1.07 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
import React, { useState, useEffect } from 'react';
import AppLoading from 'expo-app-loading';
import * as Font from 'expo-font';
import { NavigationContainer } from '@react-navigation/native';
import { OverflowMenuProvider } from 'react-navigation-header-buttons';
import { DrawerNavigator } from './src/navigation/Drawer';
import { Provider } from 'react-redux';
import store from './src/store';
import { DB } from './src/db';
export default function App() {
const [isReady, setIsReady] = useState(false);
useEffect(async () => {
await Font.loadAsync({
'open-bold': require('./assets/fonts/OpenSans-Bold.ttf'),
'open-regular': require('./assets/fonts/OpenSans-Regular.ttf'),
})
try {
await DB.init()
setIsReady(true)
}
catch (e) {
console.log(e);
}
}, [])
if (!isReady) {
return (
<AppLoading />
)
}
return (
<Provider store={store}>
<NavigationContainer>
<OverflowMenuProvider>
<DrawerNavigator/>
</OverflowMenuProvider>
</NavigationContainer>
</Provider>
);
}