-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
40 lines (32 loc) · 924 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, { useEffect, useState } from 'react'
import { AppLoading } from 'expo'
import * as Font from 'expo-font'
import { Ionicons } from '@expo/vector-icons'
import Omise from 'omise-react-native'
import { Provider } from 'mobx-react'
import { rootStore } from './src/stores/RootStore'
import Main from './src/views/main.jsx'
import { OMISE_TOKEN } from 'react-native-dotenv'
Omise.config(OMISE_TOKEN, '2019-05-29')
const App = () => {
const [isReady, setIsReady] = useState(false)
const loadFont = async () => {
await Font.loadAsync({
Roboto: require('native-base/Fonts/Roboto.ttf'),
Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),
...Ionicons.font,
})
setIsReady(true)
}
useEffect(() => {
loadFont()
}, [])
return isReady ? (
<Provider rootStore={rootStore}>
<Main />
</Provider>
) : (
<AppLoading />
)
}
export default App