-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppNavigator.js
57 lines (51 loc) · 1.58 KB
/
AppNavigator.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
import React from 'react';
import { Ionicons } from '@expo/vector-icons';
import { createStackNavigator } from 'react-navigation-stack';
import { createBottomTabNavigator } from 'react-navigation-tabs';
import Category from './screens/Category';
import Categories from './screens/Categories';
import Cart from './screens/Cart';
import Orders from './screens/Orders';
import Settings from './screens/Settings';
const color = {
ACTIVE: '#147EFB',
INACTIVE: '#CCC'
}
const CategoryStack = createStackNavigator({
Categories,
Category,
});
CategoryStack.navigationOptions = {
tabBarLabel: 'Home',
tabBarIcon: ({ focused }) => {
return <Ionicons name="md-planet" size={36} color={focused ? color.ACTIVE : color.INACTIVE} />;
},
};
const CartStack = createStackNavigator({ Cart });
CartStack.navigationOptions = {
tabBarLabel: 'Cart',
tabBarIcon: ({ focused }) => {
return <Ionicons name="md-cart" size={36} color={focused ? color.ACTIVE : color.INACTIVE} />;
},
};
const OrderStack = createStackNavigator({ Orders });
OrderStack.navigationOptions = {
tabBarLabel: 'Orders',
tabBarIcon: ({ focused }) => {
return <Ionicons name="md-wallet" size={36} color={focused ? color.ACTIVE : color.INACTIVE} />;
},
};
const SettingStack = createStackNavigator({ Settings });
SettingStack.navigationOptions = {
tabBarLabel: 'Settings',
tabBarIcon: ({ focused }) => {
return <Ionicons name="md-settings" size={36} color={focused ? color.ACTIVE : color.INACTIVE} />;
},
};
const AppNavigator = createBottomTabNavigator({
CategoryStack,
CartStack,
OrderStack,
SettingStack,
});
export default AppNavigator;