ordering-ui-react-native 0.17.88 → 0.17.89-release
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -7
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessInformation/index.tsx +10 -9
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +29 -8
- package/src/components/PhoneInputNumber/index.tsx +6 -2
- package/src/components/StripeMethodForm/index.tsx +136 -102
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +3 -2
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +5 -0
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +33 -26
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +163 -123
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/DriverSchedule/index.tsx +45 -8
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +31 -3
- package/themes/business/src/components/LoginForm/index.tsx +15 -22
- package/themes/business/src/components/MapView/index.tsx +14 -10
- package/themes/business/src/components/MessagesOption/index.tsx +20 -93
- package/themes/business/src/components/NewOrderNotification/index.tsx +123 -96
- package/themes/business/src/components/NotFoundSource/index.tsx +2 -2
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +202 -12
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +84 -37
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +81 -66
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +200 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +19 -18
- package/themes/business/src/components/OrderSummary/index.tsx +114 -123
- package/themes/business/src/components/OrdersOption/index.tsx +22 -22
- package/themes/business/src/components/PreviousMessages/FooterMessageComponent.tsx +103 -0
- package/themes/business/src/components/PreviousMessages/index.tsx +97 -55
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +93 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +1 -1
- package/themes/business/src/components/PreviousOrders/index.tsx +198 -221
- package/themes/business/src/components/ProductItemAccordion/index.tsx +7 -1
- package/themes/business/src/components/ReviewCustomer/index.tsx +18 -13
- package/themes/business/src/components/StoresList/index.tsx +3 -4
- package/themes/business/src/components/UserProfileForm/index.tsx +14 -15
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/types/index.tsx +25 -10
- package/themes/business/src/utils/index.tsx +29 -2
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/Intro/index.tsx +16 -1
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -9
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +2 -2
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +1 -1
- package/themes/original/src/components/AddressDetails/index.tsx +19 -3
- package/themes/original/src/components/AddressForm/index.tsx +35 -17
- package/themes/original/src/components/AddressList/index.tsx +5 -8
- package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +73 -37
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +10 -12
- package/themes/original/src/components/BusinessController/index.tsx +35 -44
- package/themes/original/src/components/BusinessController/styles.tsx +12 -5
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
- package/themes/original/src/components/BusinessInformation/index.tsx +140 -85
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
- package/themes/original/src/components/BusinessListingSearch/index.tsx +347 -336
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +0 -18
- package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
- package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
- package/themes/original/src/components/BusinessProductsList/index.tsx +15 -7
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
- package/themes/original/src/components/BusinessProductsListing/index.tsx +663 -556
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -3
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +38 -405
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +60 -51
- package/themes/original/src/components/CartContent/index.tsx +102 -58
- package/themes/original/src/components/CartContent/styles.tsx +6 -6
- package/themes/original/src/components/Checkout/index.tsx +280 -35
- package/themes/original/src/components/CitiesControl/index.tsx +1 -1
- package/themes/original/src/components/CouponControl/index.tsx +10 -3
- package/themes/original/src/components/DriverTips/index.tsx +52 -34
- package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +42 -5
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +2 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +86 -10
- package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
- package/themes/original/src/components/GoogleMap/index.tsx +63 -7
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/LoginForm/Otp/index.tsx +91 -25
- package/themes/original/src/components/LoginForm/index.tsx +64 -34
- package/themes/original/src/components/LottieAnimation/index.tsx +88 -63
- package/themes/original/src/components/MessageListing/index.tsx +9 -2
- package/themes/original/src/components/Messages/index.tsx +15 -4
- package/themes/original/src/components/MomentOption/index.tsx +193 -92
- package/themes/original/src/components/MomentSelector/index.tsx +1 -1
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +162 -50
- package/themes/original/src/components/MultiCheckout/index.tsx +385 -46
- package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +23 -19
- package/themes/original/src/components/MyOrders/index.tsx +25 -16
- package/themes/original/src/components/NavBar/index.tsx +20 -13
- package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +21 -5
- package/themes/original/src/components/OrderDetails/index.tsx +50 -38
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +34 -25
- package/themes/original/src/components/OrderSummary/index.tsx +83 -57
- package/themes/original/src/components/OrderTypeSelector/index.tsx +5 -6
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
- package/themes/original/src/components/OrdersOption/index.tsx +59 -46
- package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
- package/themes/original/src/components/PageBanner/index.tsx +65 -29
- package/themes/original/src/components/PageBanner/styles.tsx +0 -3
- package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +3 -0
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +100 -34
- package/themes/original/src/components/PhoneInputNumber/index.tsx +18 -4
- package/themes/original/src/components/ProductForm/index.tsx +87 -31
- package/themes/original/src/components/ProductForm/styles.tsx +3 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -6
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +49 -20
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +10 -9
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
- package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
- package/themes/original/src/components/Promotions/index.tsx +2 -2
- package/themes/original/src/components/Promotions/styles.tsx +3 -1
- package/themes/original/src/components/ReviewProducts/index.tsx +16 -7
- package/themes/original/src/components/ScheduleAccordion/index.tsx +3 -3
- package/themes/original/src/components/ServiceForm/index.tsx +63 -20
- package/themes/original/src/components/Sessions/styles.tsx +1 -0
- package/themes/original/src/components/SignupForm/index.tsx +43 -27
- package/themes/original/src/components/SingleOrderCard/index.tsx +42 -19
- package/themes/original/src/components/SingleOrderCard/styles.tsx +1 -1
- package/themes/original/src/components/SingleProductCard/index.tsx +37 -26
- package/themes/original/src/components/SingleProductCard/styles.tsx +9 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +61 -5
- package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
- package/themes/original/src/components/StripeElementsForm/naked.tsx +12 -1
- package/themes/original/src/components/UpsellingProducts/index.tsx +5 -10
- package/themes/original/src/components/UserDetails/index.tsx +3 -1
- package/themes/original/src/components/UserFormDetails/index.tsx +78 -9
- package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -26
- package/themes/original/src/components/UserProfileForm/index.tsx +30 -31
- package/themes/original/src/components/UserVerification/index.tsx +55 -50
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
- package/themes/original/src/components/Wallets/index.tsx +52 -62
- package/themes/original/src/components/Wallets/styles.tsx +2 -4
- package/themes/original/src/components/shared/OButton.tsx +3 -3
- package/themes/original/src/components/shared/OInput.tsx +4 -5
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/types/index.tsx +37 -10
- package/themes/original/src/utils/index.tsx +185 -13
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
- package/src/navigators/BottomNavigator.tsx +0 -117
- package/src/navigators/CheckoutNavigator.tsx +0 -66
- package/src/navigators/HomeNavigator.tsx +0 -202
- package/src/navigators/NavigationRef.tsx +0 -7
- package/src/navigators/RootNavigator.tsx +0 -269
- package/src/pages/Account.tsx +0 -34
- package/src/pages/AddressForm.tsx +0 -62
- package/src/pages/AddressList.tsx +0 -24
- package/src/pages/BusinessProductsList.tsx +0 -81
- package/src/pages/BusinessesListing.tsx +0 -43
- package/src/pages/CartList.tsx +0 -49
- package/src/pages/Checkout.tsx +0 -101
- package/src/pages/ForgotPassword.tsx +0 -24
- package/src/pages/Help.tsx +0 -23
- package/src/pages/HelpAccountAndPayment.tsx +0 -23
- package/src/pages/HelpGuide.tsx +0 -23
- package/src/pages/HelpOrder.tsx +0 -23
- package/src/pages/Home.tsx +0 -36
- package/src/pages/IntroductoryTutorial.tsx +0 -170
- package/src/pages/Login.tsx +0 -47
- package/src/pages/MomentOption.tsx +0 -30
- package/src/pages/MultiCheckout.tsx +0 -31
- package/src/pages/MultiOrdersDetails.tsx +0 -27
- package/src/pages/MyOrders.tsx +0 -40
- package/src/pages/NetworkError.tsx +0 -24
- package/src/pages/NotFound.tsx +0 -22
- package/src/pages/OrderDetails.tsx +0 -25
- package/src/pages/ProductDetails.tsx +0 -55
- package/src/pages/Profile.tsx +0 -36
- package/src/pages/ReviewDriver.tsx +0 -30
- package/src/pages/ReviewOrder.tsx +0 -32
- package/src/pages/ReviewProducts.tsx +0 -30
- package/src/pages/Sessions.tsx +0 -22
- package/src/pages/Signup.tsx +0 -53
- package/src/pages/SpinnerLoader.tsx +0 -10
- package/src/pages/Splash.tsx +0 -21
|
@@ -19,6 +19,7 @@ export interface LoginParams {
|
|
|
19
19
|
notificationState?: any;
|
|
20
20
|
handleReCaptcha?: any;
|
|
21
21
|
enableReCaptcha?: any;
|
|
22
|
+
isGuest?: any;
|
|
22
23
|
otpType?: string,
|
|
23
24
|
setOtpType: (type: string) => void,
|
|
24
25
|
generateOtpCode: (values?: any) => void,
|
|
@@ -91,7 +92,8 @@ export interface AddressFormParams {
|
|
|
91
92
|
hasAddressDefault?: any,
|
|
92
93
|
isFromCheckout?: boolean
|
|
93
94
|
afterSignup?: boolean
|
|
94
|
-
isGuestFromStore?: boolean
|
|
95
|
+
isGuestFromStore?: boolean,
|
|
96
|
+
businessSlug?: number | string
|
|
95
97
|
}
|
|
96
98
|
export interface SignupParams {
|
|
97
99
|
navigation?: any;
|
|
@@ -118,6 +120,7 @@ export interface SignupParams {
|
|
|
118
120
|
useSignUpOtpEmail?: boolean;
|
|
119
121
|
useSignUpOtpCellphone?: boolean;
|
|
120
122
|
willVerifyOtpState?: boolean;
|
|
123
|
+
isGuest?: any;
|
|
121
124
|
numOtpInputs?: number;
|
|
122
125
|
handleChangePromotions: () => void;
|
|
123
126
|
handleChangeInput?: (in1: any, in2: any) => void;
|
|
@@ -144,6 +147,7 @@ export interface PhoneInputParams {
|
|
|
144
147
|
isDisabled?: any;
|
|
145
148
|
isStartValidation?: any;
|
|
146
149
|
changeCountry?: any;
|
|
150
|
+
updateStateWithSubmit?: boolean
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
export interface LanguageSelectorParams {
|
|
@@ -252,6 +256,8 @@ export interface BusinessProductsListingParams {
|
|
|
252
256
|
handleUpdateProfessionals?: any;
|
|
253
257
|
onBusinessClick?: any;
|
|
254
258
|
onNavigationRedirect?: any;
|
|
259
|
+
businessSingleId?: number | string
|
|
260
|
+
fromMulti?: boolean
|
|
255
261
|
}
|
|
256
262
|
export interface BusinessBasicInformationParams {
|
|
257
263
|
navigation?: any;
|
|
@@ -303,6 +309,7 @@ export interface BusinessProductsListParams {
|
|
|
303
309
|
handleUpdateProducts?: any,
|
|
304
310
|
navigation?: any;
|
|
305
311
|
previouslyProducts?: any;
|
|
312
|
+
businessSingleId?: number | string
|
|
306
313
|
}
|
|
307
314
|
export interface SingleProductCardParams {
|
|
308
315
|
businessId: any;
|
|
@@ -318,7 +325,8 @@ export interface SingleProductCardParams {
|
|
|
318
325
|
navigation?: any;
|
|
319
326
|
isPreviously?: any;
|
|
320
327
|
isProductId?: any;
|
|
321
|
-
viewString?: string;
|
|
328
|
+
viewString?: string;
|
|
329
|
+
businessSingleId?: number
|
|
322
330
|
}
|
|
323
331
|
export interface BusinessInformationParams {
|
|
324
332
|
navigation?: any,
|
|
@@ -347,6 +355,8 @@ export interface NotFoundSourceParams {
|
|
|
347
355
|
conditioned?: boolean,
|
|
348
356
|
onClickButton?: any,
|
|
349
357
|
children?: any
|
|
358
|
+
hideImage?: any
|
|
359
|
+
btnStyle?: any
|
|
350
360
|
}
|
|
351
361
|
export interface OrdersOptionParams {
|
|
352
362
|
orderList?: any,
|
|
@@ -365,8 +375,8 @@ export interface OrdersOptionParams {
|
|
|
365
375
|
preOrders?: boolean,
|
|
366
376
|
reorderState?: any,
|
|
367
377
|
handleReorder?: (orderId: number) => {},
|
|
368
|
-
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength }: { activeOrdersLength: number, previousOrdersLength: number }) => void,
|
|
369
|
-
ordersLength: { activeOrdersLength: number, previousOrdersLength: number },
|
|
378
|
+
setOrdersLength?: ({ activeOrdersLength, previousOrdersLength, preordersLength }: { activeOrdersLength: number, previousOrdersLength: number, preordersLength: number }) => void,
|
|
379
|
+
ordersLength: { activeOrdersLength: number, previousOrdersLength: number, preordersLength: number },
|
|
370
380
|
setSelectedOrderId?: any,
|
|
371
381
|
setOpenMessges?: any,
|
|
372
382
|
loadMoreStatus?: boolean,
|
|
@@ -384,6 +394,7 @@ export interface OrdersOptionParams {
|
|
|
384
394
|
BusinessControllerSkeletons?: any,
|
|
385
395
|
businessPaginationProps?: any,
|
|
386
396
|
businesses?: any
|
|
397
|
+
businessId?: any;
|
|
387
398
|
}
|
|
388
399
|
export interface ActiveOrdersParams {
|
|
389
400
|
orders?: any,
|
|
@@ -427,6 +438,7 @@ export interface OrderDetailsParams {
|
|
|
427
438
|
onNavigationRedirect?: any,
|
|
428
439
|
reorderState?: any,
|
|
429
440
|
handleReorder?: any,
|
|
441
|
+
hideViaText?: boolean,
|
|
430
442
|
}
|
|
431
443
|
export interface ProductItemAccordionParams {
|
|
432
444
|
key?: any;
|
|
@@ -538,6 +550,7 @@ export interface FloatingButtonParams {
|
|
|
538
550
|
}
|
|
539
551
|
export interface MomentOptionParams {
|
|
540
552
|
navigation: any;
|
|
553
|
+
isCart?: any;
|
|
541
554
|
nopadding?: boolean;
|
|
542
555
|
datesList: Array<any>;
|
|
543
556
|
hoursList: Array<any>;
|
|
@@ -561,6 +574,9 @@ export interface BusinessPreorderParams {
|
|
|
561
574
|
goToBack: any;
|
|
562
575
|
business: any;
|
|
563
576
|
handleBusinessClick: (value: any) => {};
|
|
577
|
+
getActualSchedule?: any;
|
|
578
|
+
cateringPreorder?: boolean;
|
|
579
|
+
preorderLeadTime?: number
|
|
564
580
|
}
|
|
565
581
|
export interface BusinessMenuListParams {
|
|
566
582
|
menu: any;
|
|
@@ -584,7 +600,7 @@ export interface UpsellingProductsParams {
|
|
|
584
600
|
business?: any;
|
|
585
601
|
businessId?: number;
|
|
586
602
|
cartProducts?: Array<any>;
|
|
587
|
-
handleUpsellingPage: () => void;
|
|
603
|
+
handleUpsellingPage: (cart ?: any) => void;
|
|
588
604
|
openUpselling: boolean;
|
|
589
605
|
canOpenUpselling?: boolean;
|
|
590
606
|
setCanOpenUpselling?: (value: any) => void;
|
|
@@ -610,7 +626,10 @@ export interface GoogleMapsParams {
|
|
|
610
626
|
isSetInputs?: boolean,
|
|
611
627
|
locations?: Array<any>,
|
|
612
628
|
setSaveLocation?: (val: boolean) => void,
|
|
613
|
-
handleToggleMap?: () => void
|
|
629
|
+
handleToggleMap?: () => void,
|
|
630
|
+
isIntGeoCoder: boolean,
|
|
631
|
+
businessZones?: any
|
|
632
|
+
delta?: number
|
|
614
633
|
}
|
|
615
634
|
|
|
616
635
|
export interface HelpParams {
|
|
@@ -706,6 +725,10 @@ export interface otpParams {
|
|
|
706
725
|
handleLoginOtp: (code: string) => void,
|
|
707
726
|
setAlertState: any;
|
|
708
727
|
pinCount: number;
|
|
728
|
+
otpError: any,
|
|
729
|
+
setOtpError: any
|
|
730
|
+
isCheckingCode: boolean
|
|
731
|
+
setCheckingCode: (value: boolean) => void
|
|
709
732
|
}
|
|
710
733
|
|
|
711
734
|
export interface FavoriteParams {
|
|
@@ -732,7 +755,7 @@ export interface SingleOrderCardParams {
|
|
|
732
755
|
pastOrders: any,
|
|
733
756
|
isMessageView?: any,
|
|
734
757
|
handleClickOrder: (value: any) => {},
|
|
735
|
-
handleRemoveCart: () => {},
|
|
758
|
+
handleRemoveCart: (value: any) => {},
|
|
736
759
|
cartState: any
|
|
737
760
|
}
|
|
738
761
|
|
|
@@ -761,13 +784,16 @@ export interface ServiceFormParams {
|
|
|
761
784
|
professionalList: any,
|
|
762
785
|
productObject?: any,
|
|
763
786
|
professionalListState?: any,
|
|
764
|
-
isCartProduct?: any
|
|
787
|
+
isCartProduct?: any,
|
|
788
|
+
actionStatus?: any,
|
|
789
|
+
handleCreateGuestUser?: any
|
|
765
790
|
}
|
|
766
791
|
|
|
767
792
|
export interface ProfessionalFilterParams {
|
|
768
793
|
professionals?: any,
|
|
769
794
|
professionalSelected?: any,
|
|
770
|
-
handleChangeProfessionalSelected: any
|
|
795
|
+
handleChangeProfessionalSelected: any,
|
|
796
|
+
handleUpdateProfessionals?: any
|
|
771
797
|
}
|
|
772
798
|
|
|
773
799
|
export interface ProfessionalProfileParams {
|
|
@@ -784,7 +810,8 @@ export interface OrderItAgainParams {
|
|
|
784
810
|
currentCart: any,
|
|
785
811
|
handleUpdateProducts: any,
|
|
786
812
|
navigation: any,
|
|
787
|
-
searchValue?: string
|
|
813
|
+
searchValue?: string,
|
|
814
|
+
businessSingleId?: number | string
|
|
788
815
|
}
|
|
789
816
|
|
|
790
817
|
export interface PreviousProductsOrderedParams {
|
|
@@ -4,12 +4,18 @@ import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
|
4
4
|
import { CODES } from 'ordering-components/native'
|
|
5
5
|
import { ORDER_TYPES } from '../config/constants';
|
|
6
6
|
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
7
8
|
|
|
8
9
|
const [languageState, t] = useLanguage();
|
|
9
10
|
const theme = useTheme()
|
|
10
11
|
|
|
11
12
|
export const flatArray = (arr: any) => [].concat(...arr)
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* List of order type
|
|
16
|
+
*/
|
|
17
|
+
export const orderTypeList = ['delivery', 'pickup', 'eatin', 'curbside', 'drivethru', 'seatdelivery']
|
|
18
|
+
|
|
13
19
|
/**
|
|
14
20
|
* Function to return the traduction depending of a key 't'
|
|
15
21
|
* @param {string} key for traduction
|
|
@@ -266,6 +272,11 @@ export const transformCountryCode = (countryCode: number) => {
|
|
|
266
272
|
return code?.countryCode
|
|
267
273
|
}
|
|
268
274
|
|
|
275
|
+
export const findExitingCode = (countryCode: string) => {
|
|
276
|
+
const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
|
|
277
|
+
return code?.countryCode
|
|
278
|
+
}
|
|
279
|
+
|
|
269
280
|
/**
|
|
270
281
|
* Function to check if a number is decimal or not
|
|
271
282
|
* @param {*} value number to check if decimal or not
|
|
@@ -373,7 +384,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
373
384
|
key: 0,
|
|
374
385
|
value: t('PENDING', 'Pending'),
|
|
375
386
|
slug: 'PENDING',
|
|
376
|
-
percentage: 0.
|
|
387
|
+
percentage: 0.1,
|
|
377
388
|
image: theme.images.order.status0,
|
|
378
389
|
},
|
|
379
390
|
{
|
|
@@ -401,7 +412,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
401
412
|
key: 4,
|
|
402
413
|
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
403
414
|
slug: 'PREPARATION_COMPLETED',
|
|
404
|
-
percentage: 0.
|
|
415
|
+
percentage: 0.2,
|
|
405
416
|
image: theme.images.order.status4,
|
|
406
417
|
},
|
|
407
418
|
{
|
|
@@ -422,21 +433,21 @@ export const getOrderStatus = (s: string) => {
|
|
|
422
433
|
key: 7,
|
|
423
434
|
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
424
435
|
slug: 'ACCEPTED_BY_BUSINESS',
|
|
425
|
-
percentage: 0.
|
|
436
|
+
percentage: 0.15,
|
|
426
437
|
image: theme.images.order.status7,
|
|
427
438
|
},
|
|
428
439
|
{
|
|
429
440
|
key: 8,
|
|
430
441
|
value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
|
|
431
442
|
slug: 'ACCEPTED_BY_DRIVER',
|
|
432
|
-
percentage: 0.
|
|
443
|
+
percentage: 0.4,
|
|
433
444
|
image: theme.images.order.status8,
|
|
434
445
|
},
|
|
435
446
|
{
|
|
436
447
|
key: 9,
|
|
437
448
|
value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
|
|
438
449
|
slug: 'PICK_UP_COMPLETED_BY_DRIVER',
|
|
439
|
-
percentage: 0.
|
|
450
|
+
percentage: 0.7,
|
|
440
451
|
image: theme.images.order.status9,
|
|
441
452
|
},
|
|
442
453
|
{
|
|
@@ -474,7 +485,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
474
485
|
key: 14,
|
|
475
486
|
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
476
487
|
slug: 'ORDER_NOT_READY',
|
|
477
|
-
percentage: 0,
|
|
488
|
+
percentage: 0.15,
|
|
478
489
|
image: theme.images.order.status13,
|
|
479
490
|
},
|
|
480
491
|
{
|
|
@@ -484,7 +495,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
484
495
|
'Order picked up completed by customer',
|
|
485
496
|
),
|
|
486
497
|
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
487
|
-
percentage:
|
|
498
|
+
percentage: 1,
|
|
488
499
|
image: theme.images.order.status1,
|
|
489
500
|
},
|
|
490
501
|
{
|
|
@@ -511,7 +522,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
511
522
|
'Driver almost arrived to business',
|
|
512
523
|
),
|
|
513
524
|
slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
514
|
-
percentage: 0.
|
|
525
|
+
percentage: 0.5,
|
|
515
526
|
image: theme.images.order.status3,
|
|
516
527
|
},
|
|
517
528
|
{
|
|
@@ -531,7 +542,7 @@ export const getOrderStatus = (s: string) => {
|
|
|
531
542
|
'Customer almost arrived to business',
|
|
532
543
|
),
|
|
533
544
|
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
534
|
-
percentage:
|
|
545
|
+
percentage: 0.9,
|
|
535
546
|
image: theme.images.order.status7,
|
|
536
547
|
},
|
|
537
548
|
{
|
|
@@ -541,26 +552,187 @@ export const getOrderStatus = (s: string) => {
|
|
|
541
552
|
'Customer arrived to business',
|
|
542
553
|
),
|
|
543
554
|
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
544
|
-
percentage:
|
|
555
|
+
percentage: 0.9,
|
|
545
556
|
image: theme.images.order.status7,
|
|
546
557
|
},
|
|
547
558
|
{
|
|
548
559
|
key: 22,
|
|
549
560
|
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
550
561
|
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
551
|
-
percentage:
|
|
562
|
+
percentage: 0.3,
|
|
552
563
|
image: theme.images.order.status8
|
|
553
564
|
},
|
|
554
565
|
{
|
|
555
566
|
key: 23,
|
|
556
567
|
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
557
568
|
slug: 'ORDER_DRIVER_ON_WAY',
|
|
558
|
-
percentage:
|
|
569
|
+
percentage: 0.8,
|
|
559
570
|
image: theme.images.order.status8
|
|
560
571
|
}
|
|
561
572
|
];
|
|
562
|
-
|
|
573
|
+
|
|
563
574
|
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
564
575
|
|
|
565
576
|
return objectStatus && objectStatus;
|
|
566
577
|
}
|
|
578
|
+
|
|
579
|
+
export const getOrderStatuPickUp = (s: any) => {
|
|
580
|
+
const status = parseInt(s);
|
|
581
|
+
const orderStatus = [
|
|
582
|
+
{
|
|
583
|
+
key: 0,
|
|
584
|
+
value: t('PENDING', 'Pending'),
|
|
585
|
+
slug: 'PENDING',
|
|
586
|
+
percentage: 0.1,
|
|
587
|
+
image: theme.images.order.status0,
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
key: 1,
|
|
591
|
+
value: t('COMPLETED', 'Completed'),
|
|
592
|
+
slug: 'COMPLETED',
|
|
593
|
+
percentage: 1,
|
|
594
|
+
image: theme.images.order.status1,
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
key: 2,
|
|
598
|
+
value: t('REJECTED', 'Rejected'),
|
|
599
|
+
slug: 'REJECTED',
|
|
600
|
+
percentage: 0,
|
|
601
|
+
image: theme.images.order.status2,
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
key: 4,
|
|
605
|
+
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
606
|
+
slug: 'PREPARATION_COMPLETED',
|
|
607
|
+
percentage: 0.5,
|
|
608
|
+
image: theme.images.order.status4,
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
key: 5,
|
|
612
|
+
value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
|
|
613
|
+
slug: 'REJECTED_BY_BUSINESS',
|
|
614
|
+
percentage: 0,
|
|
615
|
+
image: theme.images.order.status5,
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
key: 7,
|
|
619
|
+
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
620
|
+
slug: 'ACCEPTED_BY_BUSINESS',
|
|
621
|
+
percentage: 0.3,
|
|
622
|
+
image: theme.images.order.status7,
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
key: 13,
|
|
626
|
+
value: t('PREORDER', 'PreOrder'),
|
|
627
|
+
slug: 'PREORDER',
|
|
628
|
+
percentage: 0,
|
|
629
|
+
image: theme.images.order.status13,
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
key: 14,
|
|
633
|
+
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
634
|
+
slug: 'ORDER_NOT_READY',
|
|
635
|
+
percentage: 0.3,
|
|
636
|
+
image: theme.images.order.status13,
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
key: 15,
|
|
640
|
+
value: t(
|
|
641
|
+
'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
642
|
+
'Order picked up completed by customer',
|
|
643
|
+
),
|
|
644
|
+
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
645
|
+
percentage: 1,
|
|
646
|
+
image: theme.images.order.status1,
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
key: 16,
|
|
650
|
+
value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
|
|
651
|
+
slug: 'CANCELLED_BY_CUSTOMER',
|
|
652
|
+
percentage: 0,
|
|
653
|
+
image: theme.images.order.status2,
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
key: 17,
|
|
657
|
+
value: t(
|
|
658
|
+
'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
659
|
+
'Order not picked up by customer',
|
|
660
|
+
),
|
|
661
|
+
slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
662
|
+
percentage: 0,
|
|
663
|
+
image: theme.images.order.status2,
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
key: 20,
|
|
667
|
+
value: t(
|
|
668
|
+
'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
669
|
+
'Customer almost arrived to business',
|
|
670
|
+
),
|
|
671
|
+
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
672
|
+
percentage: 0.7,
|
|
673
|
+
image: theme.images.order.status7,
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
key: 21,
|
|
677
|
+
value: t(
|
|
678
|
+
'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
679
|
+
'Customer arrived to business',
|
|
680
|
+
),
|
|
681
|
+
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
682
|
+
percentage: 0.9,
|
|
683
|
+
image: theme.images.order.status7,
|
|
684
|
+
}
|
|
685
|
+
];
|
|
686
|
+
|
|
687
|
+
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
688
|
+
|
|
689
|
+
return objectStatus && objectStatus;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Function to get brightness of color.
|
|
694
|
+
*/
|
|
695
|
+
export const lightenDarkenColor = (color: any) => {
|
|
696
|
+
|
|
697
|
+
let r, g, b, hsp
|
|
698
|
+
if (!color) return
|
|
699
|
+
if (color.match(/^rgb/)) {
|
|
700
|
+
// If HEX --> store the red, green, blue values in separate variables
|
|
701
|
+
color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)
|
|
702
|
+
|
|
703
|
+
r = color[1]
|
|
704
|
+
g = color[2]
|
|
705
|
+
b = color[3]
|
|
706
|
+
} else {
|
|
707
|
+
// If RGB --> Convert it to HEX
|
|
708
|
+
color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'))
|
|
709
|
+
|
|
710
|
+
r = color >> 16
|
|
711
|
+
g = color >> 8 & 255
|
|
712
|
+
b = color & 255
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// HSP (Highly Sensitive Poo) equation
|
|
716
|
+
hsp = Math.sqrt(
|
|
717
|
+
0.299 * (r * r) +
|
|
718
|
+
0.587 * (g * g) +
|
|
719
|
+
0.114 * (b * b)
|
|
720
|
+
)
|
|
721
|
+
|
|
722
|
+
// Using the HSP value, determine whether the color is light or dark
|
|
723
|
+
if (hsp > 197) {
|
|
724
|
+
return true //is light color
|
|
725
|
+
} else {
|
|
726
|
+
return false
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export const vibrateApp = (impact ?: string) => {
|
|
731
|
+
const options = {
|
|
732
|
+
enableVibrateFallback: true,
|
|
733
|
+
ignoreAndroidSystemSettings: false
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
737
|
+
|
|
738
|
+
}
|
|
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
144
144
|
{isFarAway && (
|
|
145
145
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
146
146
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
147
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
147
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
148
148
|
</FarAwayMessage>
|
|
149
149
|
)}
|
|
150
150
|
<View style={styles.wrapperOrderOptions}>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, Platform, PlatformIOSStatic } from 'react-native'
|
|
3
|
-
import { useOrder } from 'ordering-components/native'
|
|
4
|
-
import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs'
|
|
5
|
-
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
6
|
-
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
7
|
-
import styled from 'styled-components/native'
|
|
8
|
-
|
|
9
|
-
import { OText } from '../components/shared'
|
|
10
|
-
import BusinessList from '../pages/BusinessesListing'
|
|
11
|
-
import MyOrders from '../pages/MyOrders'
|
|
12
|
-
import CartList from '../pages/CartList'
|
|
13
|
-
import Profile from '../pages/Profile'
|
|
14
|
-
import { useTheme } from 'styled-components/native'
|
|
15
|
-
|
|
16
|
-
const CartsLenght = styled.View`
|
|
17
|
-
width: 25px;
|
|
18
|
-
height: 25px;
|
|
19
|
-
background-color: ${(props: any) => props.theme.colors.primary};
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
position: absolute;
|
|
24
|
-
right: 0;
|
|
25
|
-
`
|
|
26
|
-
|
|
27
|
-
const Tab = createMaterialBottomTabNavigator();
|
|
28
|
-
|
|
29
|
-
const BottomNavigator = () => {
|
|
30
|
-
const theme = useTheme()
|
|
31
|
-
const [{ carts }] = useOrder()
|
|
32
|
-
const cartsList = (carts && Object.values(carts).filter((cart: any) => cart.products.length > 0)) || []
|
|
33
|
-
const isIos = Platform.OS === 'ios'
|
|
34
|
-
const platformIOS = Platform as PlatformIOSStatic
|
|
35
|
-
const androidStyles = isIos
|
|
36
|
-
? platformIOS.isPad
|
|
37
|
-
? { paddingBottom: 30 }
|
|
38
|
-
: {}
|
|
39
|
-
: {height: 40, position: 'relative', bottom: 15}
|
|
40
|
-
return (
|
|
41
|
-
<Tab.Navigator
|
|
42
|
-
initialRouteName="BusinessList"
|
|
43
|
-
activeColor={theme.colors.primary}
|
|
44
|
-
barStyle={{ backgroundColor: theme.colors.white, ...androidStyles }}
|
|
45
|
-
labeled={false}
|
|
46
|
-
inactiveColor={theme.colors.disabled}
|
|
47
|
-
>
|
|
48
|
-
<Tab.Screen
|
|
49
|
-
name="BusinessList"
|
|
50
|
-
component={BusinessList}
|
|
51
|
-
options={{
|
|
52
|
-
tabBarIcon:
|
|
53
|
-
({ color }: any) => (
|
|
54
|
-
<View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
|
|
55
|
-
<MaterialCommunityIcon name='home' size={46} color={color} />
|
|
56
|
-
</View>
|
|
57
|
-
)
|
|
58
|
-
}}
|
|
59
|
-
/>
|
|
60
|
-
<Tab.Screen
|
|
61
|
-
name="MyOrders"
|
|
62
|
-
component={MyOrders}
|
|
63
|
-
options={
|
|
64
|
-
{
|
|
65
|
-
tabBarIcon:
|
|
66
|
-
({ color }: any) => (
|
|
67
|
-
<View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
|
|
68
|
-
<MaterialIcon name='format-list-bulleted' size={46} color={color} />
|
|
69
|
-
</View>
|
|
70
|
-
),
|
|
71
|
-
}}
|
|
72
|
-
/>
|
|
73
|
-
<Tab.Screen
|
|
74
|
-
name="Cart"
|
|
75
|
-
component={CartList}
|
|
76
|
-
options={{
|
|
77
|
-
tabBarIcon:
|
|
78
|
-
({ color }: any) => (
|
|
79
|
-
<View style={{
|
|
80
|
-
width: 50,
|
|
81
|
-
height: 50,
|
|
82
|
-
justifyContent: !isIos ? 'flex-start' : 'space-evenly',
|
|
83
|
-
position: 'relative',
|
|
84
|
-
bottom: !isIos ? 10 : 0
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
<MaterialIcon name='shopping-basket' size={46} color={color} />
|
|
88
|
-
{cartsList.length > 0 && (
|
|
89
|
-
<CartsLenght style={{ borderRadius: 100 / 2 }}>
|
|
90
|
-
<OText
|
|
91
|
-
color={theme.colors.white}
|
|
92
|
-
>
|
|
93
|
-
{cartsList.length}
|
|
94
|
-
</OText>
|
|
95
|
-
</CartsLenght>
|
|
96
|
-
)}
|
|
97
|
-
</View>
|
|
98
|
-
)
|
|
99
|
-
}}
|
|
100
|
-
/>
|
|
101
|
-
<Tab.Screen
|
|
102
|
-
name="Profile"
|
|
103
|
-
component={Profile}
|
|
104
|
-
options={{
|
|
105
|
-
tabBarIcon:
|
|
106
|
-
({ color }: any) => (
|
|
107
|
-
<View style={{ width: 50, height: 50, justifyContent: !isIos ? 'flex-start' : 'space-evenly', position: 'relative', bottom: !isIos ? 10 : 0 }}>
|
|
108
|
-
<MaterialIcon name='person' size={46} color={color} />
|
|
109
|
-
</View>
|
|
110
|
-
)
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</Tab.Navigator>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export default BottomNavigator
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createStackNavigator } from "@react-navigation/stack";
|
|
3
|
-
|
|
4
|
-
import AddressList from '../pages/AddressList'
|
|
5
|
-
import AddressForm from '../pages/AddressForm'
|
|
6
|
-
import CartList from '../pages/CartList'
|
|
7
|
-
import CheckoutPage from '../pages/Checkout';
|
|
8
|
-
import BusinessProductsList from '../pages/BusinessProductsList';
|
|
9
|
-
import MultiCheckout from '../pages/MultiCheckout';
|
|
10
|
-
|
|
11
|
-
const Stack = createStackNavigator();
|
|
12
|
-
|
|
13
|
-
const CheckoutNavigator = (props: any) => {
|
|
14
|
-
const {
|
|
15
|
-
navigation,
|
|
16
|
-
route
|
|
17
|
-
} = props;
|
|
18
|
-
|
|
19
|
-
const cartUuid = route?.params?.cartUuid
|
|
20
|
-
|
|
21
|
-
const checkoutProps = {
|
|
22
|
-
navigation,
|
|
23
|
-
route,
|
|
24
|
-
cartUuid: route?.params?.cartUuid
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Stack.Navigator>
|
|
29
|
-
{!cartUuid && (
|
|
30
|
-
<Stack.Screen
|
|
31
|
-
name="Cart"
|
|
32
|
-
component={CartList}
|
|
33
|
-
options={{ headerShown: false }}
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
<Stack.Screen
|
|
37
|
-
name="CheckoutPage"
|
|
38
|
-
children={() => <CheckoutPage {...checkoutProps} />}
|
|
39
|
-
options={{ headerShown: false }}
|
|
40
|
-
/>
|
|
41
|
-
<Stack.Screen
|
|
42
|
-
name="Business"
|
|
43
|
-
component={BusinessProductsList}
|
|
44
|
-
options={{ headerShown: false }}
|
|
45
|
-
/>
|
|
46
|
-
<Stack.Screen
|
|
47
|
-
name="AddressList"
|
|
48
|
-
component={AddressList}
|
|
49
|
-
options={{ headerShown: false }}
|
|
50
|
-
initialParams={{isFromCheckout: true}}
|
|
51
|
-
/>
|
|
52
|
-
<Stack.Screen
|
|
53
|
-
name="AddressForm"
|
|
54
|
-
component={AddressForm}
|
|
55
|
-
options={{ headerShown: false }}
|
|
56
|
-
/>
|
|
57
|
-
<Stack.Screen
|
|
58
|
-
name="MultiCheckout"
|
|
59
|
-
children={() => <MultiCheckout {...checkoutProps} />}
|
|
60
|
-
options={{ headerShown: false }}
|
|
61
|
-
/>
|
|
62
|
-
</Stack.Navigator>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export default CheckoutNavigator;
|