forked from Track7Dev/ClothingMobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
69 lines (56 loc) · 1.66 KB
/
App.js
File metadata and controls
69 lines (56 loc) · 1.66 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import React from 'react';
import { StyleSheet, Text, View, TouchableOpacity, Button, StatusBar, ScrollView } from 'react-native';
import Nav from './AppNav';
import Auth from './pages/auth';
import Header from './components/header';
import {Provider, connect} from 'react-redux';
import {createStore} from 'redux';
import Reducers from './reducers';
const loggedIn = false;
const store = createStore(Reducers, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
class Container extends React.Component {
constructor(){
super();
this.state = {loggedIn: false}
}
render(){
return(
<View style={{width: '100%', height:'100%'}}>
{/* MAIN WINDOW */}
<View style={{flex:1}}>
{/* DRAWER */}
{this.props.main.authStatus === 'AUTHORIZED' ? <Nav active={false}/> : <Auth parent={this}/>}
</View>
{/* FOOTER */}
{this.props.main.authStatus === 'AUTHORIZED' ? <View style={styles.footer}><Text style={{color: 'white'}}>Company Name Copyright 2018</Text></View> : null}
</View>
);
}
}
const mapStateToProps = (state) => {
return{
main: state.main
}
}
export const Container_MAP = connect(mapStateToProps, null)(Container);
export default class App extends React.Component {
render() {
return (
<Provider store={store}>
<Container_MAP/>
</Provider>
);
}
}
const styles = StyleSheet.create({
footer: {
backgroundColor: 'black',
borderTopWidth: 1,
borderTopColor: 'gold',
paddingTop: 5,
paddingBottom: 5,
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
}
});