forked from satya164/PocketGear
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
58 lines (49 loc) · 1.25 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
54
55
56
57
58
/* @flow */
import React, { PureComponent } from 'react';
import { View, Platform, StatusBar, StyleSheet } from 'react-native';
import Expo from 'expo';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import Home from './src/components/Home';
const styles = StyleSheet.create({
container: {
flex: 1,
},
statusbar: {
height: Platform.OS === 'android' ? StatusBar.currentHeight : 0,
backgroundColor: '#fff',
},
});
type State = {
bootstrapped: boolean,
};
export default class App extends PureComponent<void, {}, State> {
state: State = {
bootstrapped: false,
};
componentWillMount() {
this._bootstrap();
}
_bootstrap = async () => {
await Expo.Font.loadAsync({
/* $FlowFixMe */
Montserrat: require('./assets/fonts/Montserrat.otf'),
/* $FlowFixMe */
'Montserrat-SemiBold': require('./assets/fonts/Montserrat-SemiBold.otf'),
...MaterialIcons.font,
});
global.requestAnimationFrame(() => {
this.setState({ bootstrapped: true });
});
};
render() {
if (!this.state.bootstrapped) {
return <Expo.AppLoading />;
}
return (
<View style={styles.container}>
<View style={styles.statusbar} />
<Home />
</View>
);
}
}