-
Notifications
You must be signed in to change notification settings - Fork 9
/
App.js
55 lines (48 loc) · 1.59 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
import React, { Component } from 'react'
import { Platform, StatusBar, StyleSheet } from 'react-native'
import { Container, Root, StyleProvider, View } from 'native-base'
import * as Font from 'expo-font';
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import { getStatusBarHeight } from 'react-native-status-bar-height'
import getTheme from './native-base-theme/components'
import platform from './native-base-theme/variables/platform'
import { Colors } from './constants'
import store from './store'
import Tabs from './components/Tabs'
export default class App extends Component {
state = { loading: true }
async componentWillMount() {
await Font.loadAsync({
Roboto: require('native-base/Fonts/Roboto.ttf'),
Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf')
})
this.setState({ loading: false })
}
render() {
if (this.state.loading) {
return <Container style={styles.container} />
}
return (
<Provider store={store.store}>
<PersistGate loading={null} persistor={store.persistor}>
<StyleProvider style={getTheme(platform)}>
<View style={styles.container}>
<Root>
<StatusBar barStyle="light-content" />
<Tabs />
</Root>
</View>
</StyleProvider>
</PersistGate>
</Provider>
)
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: Colors.BLUE1,
flex: 1,
paddingTop: Platform.OS === 'ios' ? getStatusBarHeight() : StatusBar.currentHeight
}
})