-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathroutes.js
377 lines (344 loc) · 12.5 KB
/
routes.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
import React from 'react';
import {
createAppContainer, createBottomTabNavigator, createStackNavigator, NavigationActions, StackActions,
} from 'react-navigation';
import { BottomTabBar } from 'react-navigation-tabs';
import StackViewStyleInterpolator from 'react-navigation-stack/dist/views/StackView/StackViewStyleInterpolator';
import Feather from 'react-native-vector-icons/Feather';
import ShopScreen from './screens/shop';
import SearchResult from './screens/searchResult';
import SearchFilter from './screens/searchFilter';
import Listing from './screens/listing';
import StoreScreen from './screens/store';
import ChatsScreen from './screens/chats';
import FeedScreen from './screens/feed';
import NewFeed from './screens/new-feed';
import NewChat from './screens/new-chat';
import ChatDetail from './screens/chatDetail';
import ExternalStoreScreen from './screens/externalStore';
import StoreRatingsScreen from './screens/StoreRatings';
import ProductRatingsScreen from './screens/ProductRatings';
import CreateListing from './screens/createListing';
import EditListing from './screens/editListing';
import AddListingCoupon from './screens/addListingCoupon';
import ListingAdvancedOptions from './screens/listingAdvancedOptions';
import TagEditor from './screens/tagEditor';
import CustomOptions from './screens/customOptions';
import EditInventory from './screens/editInventory';
import ShippingOptions from './screens/shippingOptions';
import AddShippingMethod from './screens/addShippingMethod';
import ListingAdvancedDetails from './screens/listingAdvancedDetails';
import Settings from './screens/settings';
import Analytics from './screens/analytics';
import ProfileSettings from './screens/profileSettings';
import Notifications from './screens/notifications';
import Policies from './screens/policies';
import ShippingAddress from './screens/shippingAddress';
import EditShippingAddress from './screens/editShippingAddress';
import ModerationSettings from './screens/moderationSettings';
import BlockedNodes from './screens/blocked-nodes';
import ServerLog from './screens/serverLog';
import Wallet from './screens/wallet';
import Transactions from './screens/transactions';
import CryptoBalance from './screens/cryptoBalance';
import SendMoney from './screens/sendMoney';
import ReceiveMoney from './screens/receiveMoney';
import PaymentSuccess from './screens/paymentSuccess';
import CheckoutOption from './screens/checkoutOption';
import CheckoutListing from './screens/checkout';
import PaymentMethod from './screens/paymentMethod';
import CheckoutModerators from './screens/checkoutModerators';
import PurchaseState from './screens/purchaseState';
import ExternalPay from './screens/externalPay';
import ExternalPaySuccess from './screens/externalPaySuccess';
import Orders from './screens/order';
import OrderDetails from './screens/orderDetails';
import WishList from './screens/wishlist';
import Categories from './screens/categories';
import SubCategories from './screens/subCategories';
import CategoryOverview from './screens/categoryOverview';
import CategoryResult from './screens/categoryResult';
import QueryResult from './screens/queryResult';
import Followings from './screens/followings';
import Followers from './screens/followers';
import StoreModerators from './screens/storeModerators';
import AddModerators from './screens/addModerators';
import ModeratorDetails from './screens/moderatorDetails';
import FeedDetail from './screens/feedDetail';
import Me from './screens/Me';
import EditVariants from './screens/editVariants';
import Onboarding from './screens/onboarding';
import Privacy from './screens/privacy';
import NotificationSettings from './screens/notificationSettings';
import ChatNavIcon from './components/atoms/ChatNavIcon';
import ProfilePicture from './components/atoms/ProfilePicture';
import PlusButton from './components/atoms/PlusButton';
import Resync from './screens/Resync';
import AcceptedCoins from './screens/acceptedCoins';
import BackupProfileInit from './screens/backupProfileInit';
import BackupProfilePassword from './screens/backupProfilePassword';
import BackupProfileUpload from './screens/backupProfileUpload';
import RestoreProfileInit from './screens/restoreProfileInit';
import RestoreProfilePassword from './screens/restoreProfilePassword';
import Hashtag from './screens/hashtag';
import { eventTracker } from './utils/EventTracker';
const ShopTab = createStackNavigator(
{
ShopScreen: { screen: ShopScreen },
},
{
headerMode: 'none',
},
);
const ChatsTab = createStackNavigator(
{
ChatsScreen: { screen: ChatsScreen },
},
{
headerMode: 'none',
},
);
const FeedTab = createStackNavigator(
{
FeedScreen: { screen: FeedScreen },
},
{
headerMode: 'none',
},
);
const MeTab = createStackNavigator(
{
WalletMain: { screen: Me },
Store: { screen: StoreScreen },
},
{
headerMode: 'none',
transitionConfig: () => ({
screenInterpolator: sceneProps => StackViewStyleInterpolator.forHorizontal(sceneProps),
}),
},
);
let currentIndex;
const MainTab = createBottomTabNavigator(
{
Shop: {
screen: ShopTab,
navigationOptions: {
tabBarOnPress: ({ defaultHandler }) => {
eventTracker.trackEvent('MainNavigationTap-Discover');
defaultHandler();
},
tabBarIcon: ({ focused }) => (
<Feather name="shopping-cart" size={23} color={focused ? '#00bf65' : '#969696'} />
),
},
},
Feed: {
screen: FeedTab,
navigationOptions: {
tabBarOnPress: ({ defaultHandler }) => {
eventTracker.trackEvent('MainNavigationTap-Social');
defaultHandler();
},
tabBarIcon: ({ focused }) => (
<Feather name="users" size={23} color={focused ? '#00bf65' : '#969696'} />
),
},
},
Plus: {
screen: () => null,
navigationOptions: {
tabBarOnPress: ({ defaultHandler }) => {
eventTracker.trackEvent('MainNavigationTap-Create');
defaultHandler();
},
tabBarIcon: () => <PlusButton />,
},
},
Chat: {
screen: ChatsTab,
navigationOptions: {
tabBarOnPress: ({ defaultHandler }) => {
eventTracker.trackEvent('MainNavigationTap-Chat');
defaultHandler();
},
tabBarIcon: ({ focused }) => <ChatNavIcon focused={focused} />,
},
},
Me: {
screen: MeTab,
navigationOptions: {
tabBarOnPress: ({ defaultHandler }) => {
eventTracker.trackEvent('MainNavigationTap-Me');
defaultHandler();
},
tabBarIcon: ({ focused }) => <ProfilePicture focused={focused} />,
},
},
},
{
tabBarPosition: 'bottom',
swipeEnabled: false,
lazy: false,
tabBarComponent: props => (
<BottomTabBar
{...props}
onTabPress={(tabInfo) => {
if (tabInfo.route.routeName === 'Me') {
const resetTabAction = NavigationActions.navigate({
routeName: 'Me',
action: StackActions.reset({
index: 0,
actions: [NavigationActions.navigate({ routeName: 'WalletMain' })],
}),
});
props.navigation.dispatch(resetTabAction);
} else {
props.onTabPress(tabInfo);
}
}}
/>
),
animationEnabled: false,
removeClippedSubviews: true,
tabBarOptions: {
showLabel: false,
activeTintColor: '#000000',
tabStyle: {
justifyContent: 'center',
alignItems: 'center',
},
},
},
);
const SettingsStack = createStackNavigator(
{
MainSettings: { screen: Settings },
ProfileSettings: { screen: ProfileSettings },
Notifications: { screen: Notifications },
Policies: { screen: Policies },
ShippingAddress: { screen: ShippingAddress },
ModerationSettings: { screen: ModerationSettings },
StoreModerators: { screen: StoreModerators },
AddModerators: { screen: AddModerators },
ModeratorDetails: { screen: ModeratorDetails },
BlockedNodes: { screen: BlockedNodes },
Analytics: { screen: Analytics },
Resync: { screen: Resync },
AcceptedCoins: { screen: AcceptedCoins },
ServerLog: { screen: ServerLog },
NotificationSettings: { screen: NotificationSettings },
BackupProfileInit: { screen: BackupProfileInit },
BackupProfilePassword: { screen: BackupProfilePassword },
BackupProfileUpload: { screen: BackupProfileUpload },
RestoreProfileInit: { screen: RestoreProfileInit },
RestoreProfilePassword: { screen: RestoreProfilePassword },
},
{
headerMode: 'none',
cardStyle: {
shadowColor: 'transparent',
},
transitionConfig: () => ({
screenInterpolator: sceneProps => StackViewStyleInterpolator.forHorizontal(sceneProps),
}),
},
);
const AppNavigator = createStackNavigator(
{
MainNav: { screen: MainTab },
Listing: { screen: Listing },
ShippingOptions: { screen: ShippingOptions },
AddShippingMethod: { screen: AddShippingMethod },
ExternalStore: { screen: ExternalStoreScreen },
MyStore: { screen: StoreScreen },
ExternalFollowings: { screen: Followings },
ExternalFollowers: { screen: Followers },
Feed: { screen: FeedScreen },
FeedDetail: { screen: FeedDetail },
StoreRatings: { screen: StoreRatingsScreen },
ProductRatings: { screen: ProductRatingsScreen },
CreateListing: { screen: CreateListing },
EditListing: { screen: EditListing },
AddListingCoupon: { screen: AddListingCoupon },
TagEditor: { screen: TagEditor },
ListingAdvancedOptions: { screen: ListingAdvancedOptions },
AdvancedDetails: { screen: ListingAdvancedDetails },
CustomOptions: { screen: CustomOptions },
EditVariants: { screen: EditVariants },
EditInventory: { screen: EditInventory },
Settings: { screen: SettingsStack },
ChatDetail: { screen: ChatDetail },
NewChat: { screen: NewChat },
NewFeed: { screen: NewFeed },
SearchResult: { screen: SearchResult },
SearchFilter: { screen: SearchFilter },
WishList: { screen: WishList },
Wallet: { screen: Wallet },
Transactions: { screen: Transactions },
CryptoBalance: { screen: CryptoBalance },
SendMoney: { screen: SendMoney },
ReceiveMoney: { screen: ReceiveMoney },
PaymentSuccess: { screen: PaymentSuccess },
Orders: { screen: Orders, header: null },
OrderDetails: { screen: OrderDetails, header: null },
ModeratorDetails: { screen: ModeratorDetails },
Categories: { screen: Categories },
CategoryOverview: { screen: CategoryOverview },
CategoryResult: { screen: CategoryResult },
QueryResult: { screen: QueryResult },
SubCategories: { screen: SubCategories },
ProfileSettings: { screen: ProfileSettings },
Followings: { screen: Followings },
Followers: { screen: Followers },
Notifications: { screen: Notifications },
EditShippingAddress: { screen: EditShippingAddress },
// Checkout flow
CheckoutOption: { screen: CheckoutOption },
CheckoutListing: { screen: CheckoutListing },
CheckoutShippingAddress: { screen: ShippingAddress },
CheckoutReceiveMoney: { screen: ReceiveMoney },
PaymentMethod: { screen: PaymentMethod },
CheckoutModerators: { screen: CheckoutModerators },
CheckoutModeratorDetails: { screen: ModeratorDetails },
PurchaseState: { screen: PurchaseState },
ExternalPay: { screen: ExternalPay },
ExternalPaySuccess: { screen: ExternalPaySuccess },
Hashtag: { screen: Hashtag },
},
{
cardStyle: {
shadowColor: 'transparent',
},
headerMode: 'none',
transitionConfig: () => ({
screenInterpolator: (sceneProps) => {
const { routeName, params } = sceneProps.scene.route;
if (routeName === 'SearchResult') {
return null;
} else if (routeName === 'CategoryResult' && params.searchAutoFocus) {
return null;
} else {
return StackViewStyleInterpolator.forHorizontal(sceneProps);
}
},
}),
},
);
export const OnboardingNavigator = createStackNavigator(
{
Onboarding: { screen: Onboarding },
RestoreProfileInit: { screen: RestoreProfileInit },
RestoreProfilePassword: { screen: RestoreProfilePassword },
Privacy: { screen: Privacy },
},
{
headerMode: 'none',
transitionConfig: () => ({
screenInterpolator: sceneProps => StackViewStyleInterpolator.forHorizontal(sceneProps),
}),
},
);
export const OnboardingContainer = createAppContainer(OnboardingNavigator);
const AppContainer = createAppContainer(AppNavigator);
export default AppContainer;