-
Notifications
You must be signed in to change notification settings - Fork 8
/
App.js
executable file
·36 lines (33 loc) · 985 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
import * as React from 'react';
import { Provider as PaperProvider } from 'react-native-paper'
import { ThemeProvider } from 'react-native-elements'
import RootStackNavigator from './src/navigations/RootStackNavigator'
import { Provider } from 'react-redux'
import store from './src/redux/store'
import * as Font from 'expo-font'
import { AppLoading } from 'expo'
const getFonts = () => Font.loadAsync({
'lato-bold': require('./assets/fonts/Lato-Bold.ttf'),
'lato-regular': require('./assets/fonts/Lato-Regular.ttf')
})
export default function App() {
const [fontsLoaded, setFontsLoaded] = React.useState(false)
if(fontsLoaded) {
return (
<Provider store={store}>
<ThemeProvider>
<PaperProvider>
<RootStackNavigator />
</PaperProvider>
</ThemeProvider>
</Provider>
)
} else {
return (
<AppLoading
startAsync={getFonts}
onFinish={() => setFontsLoaded(true)}
/>
)
}
}