-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTabbar.js
197 lines (193 loc) · 5.46 KB
/
Tabbar.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import React from 'react';
import { Button, Text, View, TouchableOpacity, StyleSheet } from 'react-native';
//import all the basic component we have used
import Ionicons from 'react-native-vector-icons/Ionicons';
//import Ionicons to show the icon for bottom options
//For React Navigation 3+
//import {
// createStackNavigator,
// createBottomTabNavigator,
// createAppContainer,
//} from 'react-navigation';
//For React Navigation 4+
import { createAppContainer } from 'react-navigation';
import { createBottomTabNavigator } from 'react-navigation-tabs';
import { createStackNavigator } from 'react-navigation-stack';
import HomeScreen from './pages/HomeScreen';
import SettingsScreen from './pages/SettingsScreen';
import DetailsScreen from './pages/DetailsScreen';
import ProfileScreen from './pages/ProfileScreen';
import Splash from './pages/Splash';
import Barcode from './pages/Barcode';
import Categories from './pages/Categories';
import FlashDetail from './pages/FlashDetail';
import Offers from './pages/Offers';
import brands from './pages/brands';
import Topselection from './pages/Topselection';
import Cart from './pages/Cart';
import Notisfication from './pages/Notisfication';
import { Image } from 'react-native';
import Account from './pages/Accounts';
import CASUAL_SHOES from './pages/CASUAL_SHOES';
import Login from './pages/Login';
import Signup from './pages/Signup'
import Bucket from './pages/Bucket'
const HomeStack = createStackNavigator(
{
//Defination of Navigaton from home screen
Home: { screen: HomeScreen },
Details: { screen: DetailsScreen },
Barcode: { screen: Barcode },
Categories: { screen: Categories },
FlashDetail: { screen: FlashDetail },
brands: { screen: brands },
Offers: { screen: Offers },
Bucket: { screen: Bucket },
CASUAL_SHOES:{screen:CASUAL_SHOES},
Topselection: { screen: Topselection },
Splash: {
screen: Splash,
navigationOptions: {
header: null
},
},
},
{
defaultNavigationOptions: {
//Header customization of the perticular Screen
headerStyle: {
backgroundColor: '#315660',
},
headerTintColor: 'white',
//Header title
},
}
);
const SettingsStack = createStackNavigator(
{
//Defination of Navigaton from setting screen
Settings: { screen: SettingsScreen },
Details: { screen: DetailsScreen },
Profile: { screen: ProfileScreen },
},
{
defaultNavigationOptions: {
//Header customization of the perticular Screen
headerStyle: {
backgroundColor: '#315660',
},
headerTintColor: 'white',
//Header title
},
}
);
const NotisficationStack = createStackNavigator(
{
Notisfication: { screen: Notisfication },
},
{
defaultNavigationOptions: {
//Header customization of the perticular Screen
headerStyle: {
backgroundColor: '#315660',
},
headerTintColor: 'white',
//Header title
},
}
);
const CartStack = createStackNavigator(
{
Cart: { screen: Cart }
//Defination of Navigaton from setting screen
},
{
defaultNavigationOptions: {
//Header customization of the perticular Screen
headerStyle: {
backgroundColor: '#315660',
},
headerTintColor: 'white',
//Header title
},
}
);
const AccountsSctack = createStackNavigator(
{
Account: { screen: Account },
Login:{screen: Login},
Signup:{screen:Signup}
//Defination of Navigaton from setting screen
},
{
defaultNavigationOptions: {
//Header customization of the perticular Screen
headerStyle: {
backgroundColor: '#315660',
},
headerTintColor: 'white',
//Header title
},
}
);
const Tabbar = createBottomTabNavigator(
{
Home: { screen: HomeStack },
Notisfication: { screen: NotisficationStack },
Cart: { screen: CartStack },
Account: { screen: AccountsSctack },
// Settings: { screen: SettingsStack },
},
{
defaultNavigationOptions: ({ navigation }) => ({
tabBarIcon: ({ focused, horizontal, tintColor }) => {
const { routeName } = navigation.state;
if (routeName === 'Home') {
return <Image
source={require('./images/Home.png')}
style={{ height: 25, width: 25, }}
focused={focused}
tintColor={tintColor}
/>;
}
if (routeName === 'Notisfication') {
return <Image
source={require('./images/Notification.png')}
style={{ height: 25, width: 25, }}
focused={focused}
tintColor={tintColor}
/>;
}
if (routeName === 'Cart') {
return <Image
source={require('./images/Cart.png')}
style={{ height: 25, width: 25, }}
focused={focused}
tintColor={tintColor}
/>;
}
if (routeName === 'Account') {
return <Image
source={require('./images/Account.png')}
style={{ height: 25, width: 25, }}
focused={focused}
tintColor={tintColor}
/>;
}
if (routeName === 'Setting') {
return <Image
source={require('./images/Account.png')}
style={{ height: 25, width: 25, }}
focused={focused}
tintColor={tintColor}
/>;
}
},
}),
tabBarOptions: {
activeTintColor: 'brown',
inactiveTintColor: 'black',
},
}
);
export default createAppContainer(Tabbar);