-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
64 lines (50 loc) · 1.69 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
59
60
61
62
import React from 'react';
import {Font} from 'expo';
import {Provider} from 'react-redux'
import {createStore} from 'redux'
import questionApp from './reducers'
import Expo from 'expo';
import {StatusBar, View} from "react-native";
import QuestionOrSummary from "./src/QuestionOrSummary/QuestionOrSummary";
import {Body, Button, Header, Icon, Left, Right, Subtitle, Title} from "native-base";
export default class App extends React.Component {
constructor() {
super();
this.state = {
fontLoaded: false,
store: createStore(questionApp)
};
}
async componentDidMount() {
await Font.loadAsync({
'nixie-one-regular': require('./assets/fonts/NixieOne-Regular.ttf'),
'Roboto': require('native-base/Fonts/Roboto.ttf'),
'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
});
this.setState({fontLoaded: true})
}
render() {
if (!this.state.fontLoaded) {
return <Expo.AppLoading/>
}
return (
<Provider store={this.state.store}>
<View key="main" style={{flex: 1}}>
<StatusBar hidden/>
<Header>
<Left>
<Button transparent>
<Icon name='menu'/>
</Button>
</Left>
<Body>
<Title>Cloud Courses</Title>
</Body>
<Right/>
</Header>
<QuestionOrSummary/>
</View>
</Provider>
);
}
}