-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
45 lines (40 loc) · 1.06 KB
/
App.js
File metadata and controls
45 lines (40 loc) · 1.06 KB
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
import React from 'react';
import { Provider } from 'react-redux';
import { createAppContainer } from 'react-navigation';
import { Root } from 'native-base';
import { Font, AppLoading } from 'expo';
import BookSearchNavigator from './app/modules/BooksSearch/routing';
import store from './app/store/store';
const AppContainer = createAppContainer(BookSearchNavigator);
const Roboto = require('native-base/Fonts/Roboto.ttf');
const RobotoMedium = require('native-base/Fonts/Roboto_medium.ttf');
export default class App extends React.PureComponent {
constructor(props) {
super(props);
this.state = { loading: true };
}
async componentWillMount() {
await Font.loadAsync({
Roboto,
Roboto_medium: RobotoMedium,
});
this.setState({ loading: false });
}
render() {
const { loading } = this.state;
if (loading) {
return (
<Root>
<AppLoading />
</Root>
);
}
return (
<Root>
<Provider store={ store }>
<AppContainer />
</Provider>
</Root>
);
}
}