-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
47 lines (42 loc) · 1.3 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
import React from 'react';
import { Font, AppLoading } from 'expo';
import { StyleSheet, View, Dimensions, Image, Animated, PanResponder } from 'react-native';
import { Container, Button, Text } from 'native-base';
import { Provider, Subscribe } from 'unstated';
import { AppStateContainer, StoryContainer } from './containers';
import { Credit, } from './screens';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
fontLoaded: false
};
}
async componentDidMount() {
await Expo.Font.loadAsync({
'Roboto': require('native-base/Fonts/Roboto.ttf'),
'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
'Retron2000': require('./assets/fonts/Retron2000.ttf'),
'Europhonic': require('./assets/fonts/Europhonic.otf'),
});
this.setState({ fontLoaded: true, });
}
render() {
return (
<Provider>
<Subscribe to={[AppStateContainer, StoryContainer]}>
{(state, story) => (
<Container>
{ this.state.fontLoaded
? story.isLast()
? <Credit/>
: state.state.page
: <AppLoading/>
}
</Container>
)}
</Subscribe>
</Provider>
);
}
}