-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
53 lines (43 loc) · 1.62 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
51
52
53
import React, {Component} from 'react'
import {YellowBox} from 'react-native'
import {Font, AppLoading} from 'expo'
import {Provider} from 'mobx-react'
import AuthNav from './Navigators/AuthNav'
import postStore from './Store/PostStore'
import userStore from './Store/UserStore'
YellowBox.ignoreWarnings(["Require cycle:"])
YellowBox.ignoreWarnings(['Setting a timer']);
export default class App extends Component{
constructor(props){
super(props)
this.state = {assetsLoaded: false}
}
// need to load in assets such as fonts from the start
componentDidMount = async() => {
await Font.loadAsync({
'pacifico': require('./Assets/Fonts/Pacifico.ttf'),
'caviar-dreams': require('./Assets/Fonts/CaviarDreams.ttf'),
'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
'Material Design Icons': require('native-base/Fonts/MaterialCommunityIcons.ttf'),
'MaterialCommunityIcons': require('native-base/Fonts/MaterialCommunityIcons.ttf'),
'Ionicons': require('native-base/Fonts/Ionicons.ttf'),
'FontAwesome' : require('native-base/Fonts/FontAwesome.ttf')
})
this.setState({assetsLoaded: true})
}
render = () => {
// wait for assets to load
if(this.state.assetsLoaded) {
return(
<Provider store = {postStore} userStore = {userStore}>
<AuthNav/>
</Provider>
)
}
else {
return (
<AppLoading/>
)
}
}
};