-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.js
41 lines (37 loc) · 1022 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
41
import React from 'react';
import * as Expo from 'expo'
import { Provider } from 'react-redux';
import { View } from 'react-native';
import store from './store';
import { Icon } from 'native-base'
if (process.env.NODE_ENV !== 'production') require('./secrets');
import Main from './components/main'
export default class App extends React.Component {
constructor() {
super()
this.state = {
isReady: false,
}
}
componentWillMount() {
this.loadFonts();
}
// Android doesn't natively have the fonts that native-base uses...
async loadFonts() {
await Expo.Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
Ionicons: require("@expo/vector-icons/fonts/Ionicons.ttf")
});
this.setState({ isReady: true });
}
render() {
const { isReady } = this.state
if (!isReady) return <View />
return (
<Provider store={store}>
<Main />
</Provider>
)
}
}