-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
52 lines (45 loc) · 1.21 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
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { Font, AppLoading } from 'expo';
import { Alert } from 'react-native';
import createStore from './App/Store';
import App from './App/index';
// Export store
export const store = createStore();
// Export App
export default class MealerApp extends Component {
constructor() {
super();
// walk around for firebase timer RN warnings
console.ignoredYellowBox = [
'Setting a timer',
];
this.state = {
fontLoaded: false,
};
}
async componentWillMount() {
try {
/* eslint-disable global-require */
await Font.loadAsync({
'proximanova-regular': require('./App/Assets/Fonts/ProximaNova-Regular.ttf'),
'proximanova-bold': require('./App/Assets/Fonts/ProximaNova-Bold.ttf'),
'Roboto_ medium': require('./App/Assets/Fonts/Roboto-Medium.ttf'),
});
/* eslint-enable global-require */
this.setState({
fontLoaded: true,
});
}
catch (e) {
Alert.alert('Error', e);
}
}
render() {
if (this.state.fontLoaded) {
return <Provider store={store}><App/></Provider>;
} else {
return <AppLoading/>;
}
}
}