-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.js
65 lines (57 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
63
64
65
import React from 'react';
import {View,Text, AppRegistry,StyleSheet, Dimensions} from 'react-native';
import { Provider } from 'react-redux'
import storeFactory from './store/store'
import { PersistGate } from 'redux-persist/es/integration/react'
import AppWithNavigationState from './AppNavigator';
import Footer from './common/footer'
const window = Dimensions.get('window');
const FOOTER_HEIGHT = window.height/10
const REST_OF_APP_HEIGHT = window.height//(window.height*9)/10
// const saveState = () => {
// console.log("SAVING STATE...")
// }
const { persistor, store } = storeFactory()
//store.subscribe(saveState)
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<PersistGate
loading={<Text> Loading... </Text>}
persistor={persistor}>
<View style={styles.container}>
<View style={styles.appView}>
<AppWithNavigationState/>
</View>
{/* <View style={styles.footer}>
<Footer footerHeight={FOOTER_HEIGHT}/>
</View> */}
</View>
</PersistGate>
</Provider>
)
}
}
const styles = StyleSheet.create({
container: {
flex:1,
},
footer: {
//flex:1
height:FOOTER_HEIGHT,
width:"100%"
},
appView: {
//flex:9
height:REST_OF_APP_HEIGHT,
width:"100%"
}
})
// async componentDidMount() {
// await Font.loadAsync({
// 'open-sans-bold': require('./assets/fonts/OpenSans-Bold.ttf'),
// 'open-sans-regular': require('./assets/fonts/OpenSans-Regular.ttf'),
// });
// this.setState({ fontLoaded: true });
// }