-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
80 lines (78 loc) · 2.06 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
//Our routing setup
import React from 'react'
//import { createBottomTabNavigator } from 'react-navigation'
import { createDrawerNavigator } from 'react-navigation'
//import Ionicons from 'react-native-vector-icons/Ionicons'
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
import One from './src/screen1'
import Two from './src/screen2'
import Three from './src/screen3'
import BLUE from './constants'
export default createDrawerNavigator(
{
Screen1: {
screen: One,
navigationOptions: {
drawerLabel: 'Stargate',
drawerIcon: ({ tintColor }) => (
<MaterialIcons name='grade' size={24} style={{color: tintColor}} />
)
}
},
Screen2: {
screen: Two,
navigationOptions: {
drawerLabel: 'Batman',
drawerIcon: ({ tintColor }) => (
<MaterialIcons name='favorite' size={24} style={{color: tintColor}} />
)
}
},
Screen3: {
screen: Three,
navigationOptions: {
drawerLabel: 'Spiderman',
drawerIcon: ({ tintColor }) => (
<MaterialIcons name='pets' size={24} style={{color: tintColor}} />
)
}
}
}, {
inititalRouteName: 'Screen1',
contentOptions: {
activeTintColor: BLUE,
itemsContainerStyle: {
marginVertical: 65
}
}
}
)
/*
export default createBottomTabNavigator (
{
Stargate: One,
Batman: Two,
Spiderman: Three
},
{
navigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, tintColor }) => {
const { routeName } = navigation.state
let iconName
if(routeName === 'Stargate'){
iconName = focused ? 'ios-videocam' : 'ios-play'
} else if(routeName === 'Batman'){
iconName = focused ? 'ios-videocam' : 'ios-play'
} else if(routeName === 'Spiderman'){
iconName = focused ? 'ios-videocam' : 'ios-play'
}
return <Ionicons name={iconName} size={25} color={tintColor} />
}
}),
tabBarOptions: {
activeTintColor: BLUE,
inactiveTintClolor: 'gray'
}
}
)
*/