-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppNavigator.js
410 lines (405 loc) · 11.1 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
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
import * as React from 'react';
import { I18nManager, Platform, StyleSheet, Text, View } from 'react-native';
import { systemWeights } from 'react-native-typography';
import { Icon, Touchable } from '@draftbit/ui';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import theme from './themes/DraftbitTheme.js';
import LinkingConfiguration from './LinkingConfiguration.js';
import AboutusScreen from './screens/AboutusScreen';
import AddnewaddressScreen from './screens/AddnewaddressScreen';
import CartEmptyScreen from './screens/CartEmptyScreen';
import CartScreen from './screens/CartScreen';
import ChangePasswordErrorScreen from './screens/ChangePasswordErrorScreen';
import ChangePasswordSuccessScreen from './screens/ChangePasswordSuccessScreen';
import CheckoutScreen from './screens/CheckoutScreen';
import ConfirmCodeScreen from './screens/ConfirmCodeScreen';
import DeliveryAddressScreen from './screens/DeliveryAddressScreen';
import DeliveryDetailsScreen from './screens/DeliveryDetailsScreen';
import EditProfileScreen from './screens/EditProfileScreen';
import ForgotPasswordScreen from './screens/ForgotPasswordScreen';
import GetDiscountScreen from './screens/GetDiscountScreen';
import HomeScreen from './screens/HomeScreen';
import ItemDetailsScreen from './screens/ItemDetailsScreen';
import LoginScreen from './screens/LoginScreen';
import NewPasswordScreen from './screens/NewPasswordScreen';
import NotificationDetailsScreen from './screens/NotificationDetailsScreen';
import NotificationsScreen from './screens/NotificationsScreen';
import OnboardingScreen from './screens/OnboardingScreen';
import OrdersScreen from './screens/OrdersScreen';
import PaymentmethodsScreen from './screens/PaymentmethodsScreen';
import ProfileScreen from './screens/ProfileScreen';
import PromocodeScreen from './screens/PromocodeScreen';
import RestaurantDetailsScreen from './screens/RestaurantDetailsScreen';
import SearchScreen from './screens/SearchScreen';
import SearchaddressScreen from './screens/SearchaddressScreen';
import SignupScreen from './screens/SignupScreen';
import WelcomeScreen from './screens/WelcomeScreen';
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
function Placeholder() {
return (
<View
style={{
flex: 1,
backgroundColor: '#131A2A',
justifyContent: 'center',
alignItems: 'center',
padding: 36,
}}
>
<Text
style={{
textAlign: 'center',
fontSize: 24,
fontWeight: 'bold',
marginBottom: 12,
color: '#FFF',
}}
>
Missing Screen
</Text>
<Text
style={{
textAlign: 'center',
fontSize: 16,
color: '#FFF',
marginBottom: 8,
}}
>
This screen is not in a navigator.
</Text>
<Text
style={{
textAlign: 'center',
fontSize: 16,
color: '#FFF',
marginBottom: 8,
}}
>
Go to Navigation mode, and click the + (plus) icon in the Navigator tab
on the left side to add this screen to a Navigator.
</Text>
<Text style={{ textAlign: 'center', fontSize: 16, color: '#FFF' }}>
If the screen is in a Tab Navigator, make sure the screen is assigned to
a tab in the Config panel on the right.
</Text>
</View>
);
}
function BottomTabNavigator() {
return (
<Tab.Navigator
initialRouteName="HomeScreen"
tabBarOptions={{
activeTintColor: theme.colors['Primary'],
style: { borderTopColor: 'transparent' },
}}
>
<Tab.Screen
name="HomeScreen"
component={HomeScreen}
options={{
title: 'Home',
tabBarIcon: ({ focused, color }) => (
<Icon
name="AntDesign/home"
size={25}
color={focused ? theme.colors['Primary'] : color}
/>
),
}}
/>
<Tab.Screen
name="OrdersScreen"
component={OrdersScreen}
options={{
title: 'Orders',
tabBarIcon: ({ focused, color }) => (
<Icon
name="Ionicons/ios-document-text-outline"
size={25}
color={focused ? theme.colors['Primary'] : color}
/>
),
}}
/>
<Tab.Screen
name="CartScreen"
component={CartScreen}
options={{
title: 'Cart',
tabBarIcon: ({ focused, color }) => (
<Icon
name="Ionicons/cart-outline"
size={25}
color={focused ? theme.colors['Primary'] : color}
/>
),
}}
/>
<Tab.Screen
name="SearchScreen"
component={SearchScreen}
options={{
title: 'Search',
tabBarIcon: ({ focused, color }) => (
<Icon
name="Feather/search"
size={25}
color={focused ? theme.colors['Primary'] : color}
/>
),
}}
/>
<Tab.Screen
name="ProfileScreen"
component={ProfileScreen}
options={{
title: 'Profile',
tabBarIcon: ({ focused, color }) => (
<Icon
name="FontAwesome/user-circle"
size={25}
color={focused ? theme.colors['Primary'] : color}
/>
),
}}
/>
</Tab.Navigator>
);
}
export default function RootAppNavigator() {
return (
<NavigationContainer linking={LinkingConfiguration}>
<Stack.Navigator headerMode="none" initialRouteName="OnboardingScreen">
<Stack.Screen
name="WelcomeScreen"
component={WelcomeScreen}
options={{
title: 'Welcome Screen',
}}
/>
<Stack.Screen
name="EditProfileScreen"
component={EditProfileScreen}
options={{
title: 'Edit Profile',
}}
/>
<Stack.Screen
name="DeliveryAddressScreen"
component={DeliveryAddressScreen}
options={{
title: 'Delivery Address',
}}
/>
<Stack.Screen
name="PaymentmethodsScreen"
component={PaymentmethodsScreen}
options={{
title: 'Payment methods',
}}
/>
<Stack.Screen
name="PromocodeScreen"
component={PromocodeScreen}
options={{
title: 'Promo code',
}}
/>
<Stack.Screen
name="GetDiscountScreen"
component={GetDiscountScreen}
options={{
title: 'Get Discount',
}}
/>
<Stack.Screen
name="NotificationsScreen"
component={NotificationsScreen}
options={{
title: 'Notifications',
}}
/>
<Stack.Screen
name="NotificationDetailsScreen"
component={NotificationDetailsScreen}
options={{
title: 'Notification Details',
}}
/>
<Stack.Screen
name="AboutusScreen"
component={AboutusScreen}
options={{
title: 'About us',
}}
/>
<Stack.Screen
name="AddnewaddressScreen"
component={AddnewaddressScreen}
options={{
title: 'Add new address',
}}
/>
<Stack.Screen
name="SearchaddressScreen"
component={SearchaddressScreen}
options={{
title: 'Search address',
}}
/>
<Stack.Screen
name="SignupScreen"
component={SignupScreen}
options={{
title: 'Sign up',
}}
/>
<Stack.Screen
name="LoginScreen"
component={LoginScreen}
options={{
title: 'Log in',
}}
/>
<Stack.Screen
name="ForgotPasswordScreen"
component={ForgotPasswordScreen}
options={{
title: 'Forgot Password',
}}
/>
<Stack.Screen
name="NewPasswordScreen"
component={NewPasswordScreen}
options={{
title: 'New Password ',
}}
/>
<Stack.Screen
name="ChangePasswordSuccessScreen"
component={ChangePasswordSuccessScreen}
options={{
title: 'Change Password Success',
}}
/>
<Stack.Screen
name="DeliveryDetailsScreen"
component={DeliveryDetailsScreen}
options={{
title: 'Delivery Details',
}}
/>
<Stack.Screen
name="CheckoutScreen"
component={CheckoutScreen}
options={{
title: 'Checkout',
}}
/>
<Stack.Screen
name="OnboardingScreen"
component={OnboardingScreen}
options={{
title: 'Onboarding',
}}
/>
<Stack.Screen
name="ConfirmCodeScreen"
component={ConfirmCodeScreen}
options={{
title: 'Confirm Code',
}}
/>
<Stack.Screen
name="RestaurantDetailsScreen"
component={RestaurantDetailsScreen}
options={{
title: 'Restaurant Details',
}}
/>
<Stack.Screen
name="ItemDetailsScreen"
component={ItemDetailsScreen}
options={{
title: 'Item Details',
}}
/>
<Stack.Screen
name="CartEmptyScreen"
component={CartEmptyScreen}
options={{
title: 'Cart Empty',
}}
/>
<Stack.Screen
name="ChangePasswordErrorScreen"
component={ChangePasswordErrorScreen}
options={{
title: 'Change Password Error',
}}
/>
<Stack.Screen
name="BottomTabNavigator"
component={BottomTabNavigator}
/>
</Stack.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
headerIcon: Platform.select({
ios: {
marginVertical: 12,
resizeMode: 'contain',
transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
},
default: {
margin: 3,
resizeMode: 'contain',
transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
},
}),
headerIconLeft: Platform.select({
ios: {
marginRight: 6,
},
}),
headerIconRight: Platform.select({
ios: {
marginLeft: 6,
},
}),
headerContainer: {
alignItems: 'center',
flexDirection: 'row',
...Platform.select({
ios: null,
default: {
marginVertical: 3,
marginHorizontal: 11,
},
}),
},
headerContainerLeft: Platform.select({
ios: {
marginLeft: 8,
},
}),
headerContainerRight: Platform.select({
ios: {
marginRight: 8,
},
}),
headerLabelWrapper: {
flexDirection: 'row',
alignItems: 'flex-start',
},
headerLabel: {
fontSize: 17,
letterSpacing: 0.35,
},
});