-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.js
More file actions
50 lines (41 loc) · 1.04 KB
/
App.js
File metadata and controls
50 lines (41 loc) · 1.04 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
46
47
48
49
50
import React from 'react';
import { Root } from 'native-base';
import { Font } from 'expo';
import { Button, StyleSheet, Text, View } from 'react-native';
import { StackNav } from './app/config/router.js';
import { AssetUtils } from './app/components/AssetUtils.js';
import { ThemeProvider } from 'react-native-material-ui';
const uiTheme = {
fontFamily: 'Rubik-Regular',
palette: {
primaryColor: '#578CA9',
},
toolbar: {
container: {
marginTop: 20,
height: 50,
},
},
};
export default class App extends React.Component {
state = {
assetLoaded: false,
}
async componentWillMount(){
await AssetUtils.loadAssets();
this.setState({assetLoaded: true});
}
render(){
//TODO: Added Loading View, preferrably linked with AssetUtil.loadAssets
if(!this.state.assetLoaded){
return <Text>Loading</Text>;
}
return (
<Root>
<ThemeProvider uiTheme={uiTheme}>
<StackNav />
</ThemeProvider>
</Root>
);
}
}