-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathnavigators.js
More file actions
134 lines (124 loc) · 3.19 KB
/
navigators.js
File metadata and controls
134 lines (124 loc) · 3.19 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import React from 'react';
import {
createAppContainer,
} from 'react-navigation';
import {
createStackNavigator,
} from 'react-navigation-stack';
import {
createBottomTabNavigator,
TabBarBottom,
} from 'react-navigation-tabs';
import Ionicons from 'react-native-vector-icons/Ionicons';
import { Platform } from 'react-native';
import HomeScreen from './screens/HomeScreen';
import FreeTaxScreen from './screens/FreeTaxScreen';
import DetailsScreen from './screens/DetailsScreen';
import AboutScreen from './screens/AboutScreen';
import MapScreen from './screens/MapScreen';
import MoreScreen from './screens/MoreScreen';
import ItemList from './screens/ItemList';
import admin from './screens/admin';
const HomeStack = createStackNavigator({
Home: { screen: HomeScreen },
Details: {
screen: DetailsScreen,
navigationOptions: {
tabBarLabel: 'Home',
},
},
About: {
screen: AboutScreen,
navigationOptions: {
tabBarLabel: 'About',
},
},
Free: {
screen: FreeTaxScreen,
navigationOptions: {
tabBarLabel: 'Tax',
},
},
Login: {
screen: MoreScreen,
navigationOptions: {
tabBarLabel: 'Login',
}
},
admin: {
screen: admin,
navigationOptions: {
tabBarLabel: 'admin',
},
},
});
const MapStack = createStackNavigator({
Map: { screen: MapScreen },
Details: {
screen: DetailsScreen,
navigationOptions: {
tabBarLabel: 'Map',
},
},
});
const MoreStack = createStackNavigator({
More: { screen: MoreScreen },
LocationPicker: { screen: MapScreen },
});
const ItemStack = createStackNavigator({
Item: { screen: ItemList },
});
const bottomTab = createBottomTabNavigator({
Home: { screen: HomeStack },
Map: { screen: MapStack },
Item: { screen: ItemList },
More: { screen: MoreStack },
},
{
defaultNavigationOptions: ({ navigation }) => ({
// eslint-disable-next-line react/display-name
tabBarIcon: ({ tintColor }) => {
const { routeName } = navigation.state;
let iconName;
if (Platform.isPad) {
iconName = 'ios';
} else {
iconName = 'md';
}
if (routeName === 'Home') {
// iconName = `home${focused ? '' : '-outline'}`;
iconName += '-home';
} else if (routeName === 'Map') {
// iconName = `map${focused ? '' : '-outline'}`;
iconName += '-map';
} else if (routeName === 'More') {
// iconName = `more${focused ? '' : '-outline'}`;
iconName += '-more';
} else if (routeName === 'Item') {
iconName += '-checkbox';
}
// You can return any component that you like here! We usually use an
// icon component from react-native-vector-icons
return <Ionicons name={iconName} size={30} color={tintColor} />;
},
}),
tabBarComponent: TabBarBottom,
tabBarPosition: 'bottom',
tabBarOptions: {
style: {
borderTopColor: '#DDD',
backgroundColor: 'white',
elevation: 10,
shadowOpacity: 0.1,
},
activeTintColor: '#000',
inactiveTintColor: 'gray',
showLabel: false,
labelStyle: {
fontFamily: 'mainFont',
},
},
animationEnabled: false,
swipeEnabled: false,
});
export default createAppContainer(bottomTab);