-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
100 lines (94 loc) · 2.21 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* @format
* @flow
*/
import React from 'react'
import {
createAppContainer,
createDrawerNavigator,
} from 'react-navigation';
import {
Icon,
} from 'react-native-elements'
import { createStackNavigator } from 'react-navigation-stack';
import GraphScreen from './src/screen/GraphScreen'
import GraphConfigScreen from './src/screen/GraphConfigScreen';
import GraphEditScreen from './src/screen/GraphEditScreen';
import GraphListScreen from './src/screen/GraphListScreen';
import LoginScreen from './src/screen/LoginScreen';
import SignupScreen from './src/screen/SignupScreen';
import TermsScreen from './src/screen/TermsScreen';
import UserScreen from './src/screen/UserScreen';
const graphStack = createStackNavigator({
GraphList: {
screen: GraphListScreen,
navigationOptions: {
gesturesEnabled: false,
},
},
GraphEdit: GraphEditScreen,
Graph: GraphScreen,
GraphConfig: GraphConfigScreen,
}, {
navigationOptions: ({navigation}) => ({
drawerLabel: 'Graph List',
drawerLockMode: (
navigation.state.routes[navigation.state.index].params || {}
).drawerLockMode,
drawerIcon: (<Icon
name="list"
type="font-awesome"
/>),
})
})
const userStack = createStackNavigator({
User: {
screen: UserScreen,
navigationOptions: {
gesturesEnabled: false,
},
},
}, {
navigationOptions: ({navigation}) => ({
drawerLabel: 'User',
drawerLockMode: (
navigation.state.routes[navigation.state.index].params || {}
).drawerLockMode,
drawerIcon: (<Icon
name="user"
type="font-awesome"
/>),
})
})
const pixelaDrawer = createDrawerNavigator({
GraphDrawer: {
path: '/graph',
screen: graphStack,
},
UserStack: {
path: '/user',
screen: userStack,
},
}, {
initialRouteName: 'GraphDrawer',
navigationOptions: {
header: null,
},
contentOptions: {
activeTintColor: '#e91e63',
},
})
const AppNavigator = createStackNavigator({
Login: LoginScreen,
Signup: SignupScreen,
Terms: TermsScreen,
Pixela: pixelaDrawer,
}, {
initialRouteName: 'Login',
})
const AppContainer = createAppContainer(AppNavigator);
export default class App extends React.Component {
render() {
return <AppContainer />;
}
}