-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAppNav.js
More file actions
76 lines (70 loc) · 1.52 KB
/
AppNav.js
File metadata and controls
76 lines (70 loc) · 1.52 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
70
71
72
73
74
75
76
import React, {Component} from 'react';
import { createDrawerNavigator } from 'react-navigation';
import {View, Text, Button} from 'react-native';
import Collections from './components/collections';
import App from './App';
import Header from './components/header';
import {connect} from 'react-redux';
import {Logout} from './reducers/actions';
class screen1 extends Component {
static navigationOptions = {
tabBarLabel: 'Screen 1'
}
render(){
return (<View>
<Header nav={this.props.navigation}/>
<Text>TEST TEXT</Text>
</View>)
}
}
class screen2 extends Component {
static navigationOptions = {
tabBarLabel: 'Screen 2'
}
render(){
return (<View sryle={{width: '100%', flex: 1}}>
<Header nav={this.props.navigation}/>
<Collections/>
</View>)
}
}
class logoutScreen extends Component {
static navigationOptions = {
tabBarLabel: 'LOGGING OUT'
}
componentWillMount(){
this.props.Logout();
}
render(){
return <View />
}
}
const logout = connect(mapStateToProps, {Logout})(logoutScreen);
// Manifest of possible screens
const Nav = createDrawerNavigator({
Dashboard:{
screen: screen1
},
Collections:{
screen:Collections
},
LOGOUT:{
screen: logout
}
},
{contentOptions: {
activeTintColor: 'blue',
itemsContainerStyle: {
marginVertical: 0,
},
iconContainerStyle: {
opacity: 1
}
}}
)
const mapStateToProps = (state) => {
return {
pages: state.pages
}
}
export default connect(mapStateToProps, {Logout})(Nav);