ordering-ui-react-native 0.17.23 → 0.17.24-test
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/BusinessesListing/index.tsx +1 -1
- package/src/components/OrderCreating/index.tsx +1 -21
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/StripeMethodForm/index.tsx +108 -79
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/index.tsx +5 -0
- package/src/utils/index.tsx +7 -1
- package/themes/business/index.tsx +2 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +0 -1
- package/themes/business/src/components/Chat/index.tsx +118 -107
- package/themes/business/src/components/DriverMap/index.tsx +17 -6
- package/themes/business/src/components/GoogleMap/index.tsx +58 -57
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +238 -80
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +10 -10
- package/themes/business/src/components/NewOrderNotification/index.tsx +43 -50
- package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +90 -47
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
- package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
- package/themes/business/src/components/OrderMessage/index.tsx +18 -17
- package/themes/business/src/components/OrderSummary/index.tsx +113 -121
- package/themes/business/src/components/OrdersOption/index.tsx +32 -75
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
- package/themes/business/src/components/ReviewCustomer/index.tsx +41 -24
- package/themes/business/src/components/StoresList/index.tsx +2 -2
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OModal.tsx +16 -9
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +32 -2
- package/themes/business/src/utils/index.tsx +44 -1
- 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/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
- package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
- 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 +3 -2
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +13 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +6 -0
- package/themes/original/src/components/AddressDetails/index.tsx +29 -11
- package/themes/original/src/components/AddressForm/index.tsx +49 -19
- package/themes/original/src/components/AddressList/index.tsx +26 -21
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- 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/BusinessBasicInformation/index.tsx +166 -89
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
- package/themes/original/src/components/BusinessController/index.tsx +145 -68
- package/themes/original/src/components/BusinessController/styles.tsx +22 -9
- 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 +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
- package/themes/original/src/components/BusinessListingSearch/index.tsx +350 -323
- package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
- package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
- package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +616 -495
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +7 -9
- package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +105 -78
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +5 -3
- package/themes/original/src/components/Cart/index.tsx +102 -69
- package/themes/original/src/components/CartContent/index.tsx +110 -19
- package/themes/original/src/components/CartContent/styles.tsx +15 -1
- package/themes/original/src/components/Checkout/index.tsx +323 -178
- package/themes/original/src/components/Checkout/styles.tsx +4 -2
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- 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/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +51 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +6 -4
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +178 -0
- package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
- package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +4 -2
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +12 -16
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -25
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/Home/index.tsx +13 -4
- package/themes/original/src/components/LanguageSelector/index.tsx +17 -13
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +59 -22
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +16 -42
- package/themes/original/src/components/Messages/index.tsx +32 -10
- package/themes/original/src/components/MomentOption/index.tsx +195 -88
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +197 -116
- package/themes/original/src/components/MultiCheckout/index.tsx +288 -86
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +55 -51
- package/themes/original/src/components/NavBar/index.tsx +6 -11
- package/themes/original/src/components/Notifications/index.tsx +46 -50
- package/themes/original/src/components/Notifications/styles.tsx +6 -3
- package/themes/original/src/components/OrderDetails/OrderEta.tsx +64 -0
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
- package/themes/original/src/components/OrderDetails/index.tsx +262 -368
- package/themes/original/src/components/OrderDetails/styles.tsx +3 -4
- package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
- package/themes/original/src/components/OrderProgress/index.tsx +74 -112
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +87 -59
- package/themes/original/src/components/OrderTypeSelector/index.tsx +3 -2
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
- package/themes/original/src/components/OrdersOption/index.tsx +96 -88
- package/themes/original/src/components/PageBanner/index.tsx +171 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +34 -6
- package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
- package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +230 -261
- package/themes/original/src/components/ProductForm/styles.tsx +4 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +197 -138
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- 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 +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +10 -3
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +366 -288
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +82 -67
- package/themes/original/src/components/SingleOrderCard/index.tsx +149 -63
- package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -9
- package/themes/original/src/components/SingleProductCard/index.tsx +99 -55
- package/themes/original/src/components/SingleProductCard/styles.tsx +27 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +8 -2
- package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
- package/themes/original/src/components/StripeCardsList/index.tsx +9 -2
- package/themes/original/src/components/StripeElementsForm/index.tsx +28 -15
- package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +8 -4
- package/themes/original/src/components/UserFormDetails/index.tsx +47 -7
- package/themes/original/src/components/UserProfile/index.tsx +9 -14
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
- package/themes/original/src/components/Wallets/index.tsx +94 -33
- package/themes/original/src/components/Wallets/styles.tsx +2 -0
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
- package/themes/original/src/components/shared/OButton.tsx +6 -2
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +16 -2
- package/themes/original/src/components/shared/OModal.tsx +3 -3
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +38 -9
- package/themes/original/src/utils/index.tsx +375 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -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;
|
|
@@ -173,6 +176,9 @@ export interface BusinessesListingParams {
|
|
|
173
176
|
handleChangePriceLevel?: any;
|
|
174
177
|
businessTypeSelected?: any;
|
|
175
178
|
logosLayout?: boolean;
|
|
179
|
+
isCustomLayout?: boolean;
|
|
180
|
+
citiesState?: any;
|
|
181
|
+
actualSlug?: any;
|
|
176
182
|
}
|
|
177
183
|
export interface HighestRatedBusinessesParams {
|
|
178
184
|
businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
|
|
@@ -218,6 +224,8 @@ export interface BusinessControllerParams {
|
|
|
218
224
|
setFavoriteIds?: any;
|
|
219
225
|
handleUpdateBusinessList?: any;
|
|
220
226
|
enableIntersection?: boolean;
|
|
227
|
+
isCustomLayout?: boolean;
|
|
228
|
+
getBusinessOffer?: any;
|
|
221
229
|
handleCustomUpdate?: (businessId: number, changes: any) => {};
|
|
222
230
|
}
|
|
223
231
|
export interface BusinessProductsListingParams {
|
|
@@ -244,6 +252,10 @@ export interface BusinessProductsListingParams {
|
|
|
244
252
|
handleUpdateProducts?: any;
|
|
245
253
|
professionalSelected?: any;
|
|
246
254
|
handleChangeProfessionalSelected?: any;
|
|
255
|
+
handleUpdateProfessionals?: any;
|
|
256
|
+
onBusinessClick?: any;
|
|
257
|
+
onNavigationRedirect?: any;
|
|
258
|
+
businessSingleId?: number | string
|
|
247
259
|
}
|
|
248
260
|
export interface BusinessBasicInformationParams {
|
|
249
261
|
navigation?: any;
|
|
@@ -295,6 +307,7 @@ export interface BusinessProductsListParams {
|
|
|
295
307
|
handleUpdateProducts?: any,
|
|
296
308
|
navigation?: any;
|
|
297
309
|
previouslyProducts?: any;
|
|
310
|
+
businessSingleId?: number | string
|
|
298
311
|
}
|
|
299
312
|
export interface SingleProductCardParams {
|
|
300
313
|
businessId: any;
|
|
@@ -310,6 +323,8 @@ export interface SingleProductCardParams {
|
|
|
310
323
|
navigation?: any;
|
|
311
324
|
isPreviously?: any;
|
|
312
325
|
isProductId?: any;
|
|
326
|
+
viewString?: string;
|
|
327
|
+
businessSingleId?: number
|
|
313
328
|
}
|
|
314
329
|
export interface BusinessInformationParams {
|
|
315
330
|
navigation?: any,
|
|
@@ -396,6 +411,7 @@ export interface PreviousOrdersParams {
|
|
|
396
411
|
getOrderStatus?: any,
|
|
397
412
|
orderID?: number
|
|
398
413
|
reorderLoading?: boolean,
|
|
414
|
+
loading?: boolean,
|
|
399
415
|
loadMoreOrders?: () => {},
|
|
400
416
|
handleReorder?: (orderId: number) => {},
|
|
401
417
|
onNavigationRedirect?: (route: string, params?: any) => {}
|
|
@@ -428,7 +444,8 @@ export interface ProductItemAccordionParams {
|
|
|
428
444
|
onDeleteProduct?: (product: any) => void,
|
|
429
445
|
onEditProduct?: (product: any) => void,
|
|
430
446
|
offsetDisabled?: any,
|
|
431
|
-
isFromCheckout?: any
|
|
447
|
+
isFromCheckout?: any,
|
|
448
|
+
isDisabledEdit?: any
|
|
432
449
|
}
|
|
433
450
|
export interface ReviewOrderParams {
|
|
434
451
|
order?: { id: number, business_id: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any };
|
|
@@ -527,6 +544,7 @@ export interface FloatingButtonParams {
|
|
|
527
544
|
}
|
|
528
545
|
export interface MomentOptionParams {
|
|
529
546
|
navigation: any;
|
|
547
|
+
isCart?: any;
|
|
530
548
|
nopadding?: boolean;
|
|
531
549
|
datesList: Array<any>;
|
|
532
550
|
hoursList: Array<any>;
|
|
@@ -573,7 +591,7 @@ export interface UpsellingProductsParams {
|
|
|
573
591
|
business?: any;
|
|
574
592
|
businessId?: number;
|
|
575
593
|
cartProducts?: Array<any>;
|
|
576
|
-
handleUpsellingPage: () => void;
|
|
594
|
+
handleUpsellingPage: (cart ?: any) => void;
|
|
577
595
|
openUpselling: boolean;
|
|
578
596
|
canOpenUpselling?: boolean;
|
|
579
597
|
setCanOpenUpselling?: (value: any) => void;
|
|
@@ -584,6 +602,8 @@ export interface UpsellingProductsParams {
|
|
|
584
602
|
products?: any;
|
|
585
603
|
onNavigationRedirect?: any;
|
|
586
604
|
onGoBack?: any;
|
|
605
|
+
singleBusiness?: any;
|
|
606
|
+
isFranchiseApp?: any;
|
|
587
607
|
}
|
|
588
608
|
|
|
589
609
|
export interface GoogleMapsParams {
|
|
@@ -597,7 +617,7 @@ export interface GoogleMapsParams {
|
|
|
597
617
|
isSetInputs?: boolean,
|
|
598
618
|
locations?: Array<any>,
|
|
599
619
|
setSaveLocation?: (val: boolean) => void,
|
|
600
|
-
handleToggleMap?: () => void
|
|
620
|
+
handleToggleMap?: () => void,
|
|
601
621
|
}
|
|
602
622
|
|
|
603
623
|
export interface HelpParams {
|
|
@@ -644,6 +664,7 @@ export interface BusinessSearchParams {
|
|
|
644
664
|
onNavigationRedirect?: any,
|
|
645
665
|
handleUpdateProducts: any,
|
|
646
666
|
handleUpdateBusinessList?: any;
|
|
667
|
+
brandId?: number
|
|
647
668
|
}
|
|
648
669
|
|
|
649
670
|
export interface NoNetworkParams {
|
|
@@ -665,6 +686,7 @@ export interface PlaceSpotParams {
|
|
|
665
686
|
vehicle?: any,
|
|
666
687
|
setVehicle?: any,
|
|
667
688
|
handleChangeSpot?: any
|
|
689
|
+
setPlaceSpotNumber?: any
|
|
668
690
|
}
|
|
669
691
|
|
|
670
692
|
export interface PromotionParams {
|
|
@@ -717,7 +739,7 @@ export interface SingleOrderCardParams {
|
|
|
717
739
|
pastOrders: any,
|
|
718
740
|
isMessageView?: any,
|
|
719
741
|
handleClickOrder: (value: any) => {},
|
|
720
|
-
handleRemoveCart: () => {},
|
|
742
|
+
handleRemoveCart: (value: any) => {},
|
|
721
743
|
cartState: any
|
|
722
744
|
}
|
|
723
745
|
|
|
@@ -730,7 +752,7 @@ export interface PreviousBusinessOrderedParams {
|
|
|
730
752
|
isBusinessesSearchList?: any,
|
|
731
753
|
businessLoading?: boolean,
|
|
732
754
|
businesses?: any
|
|
733
|
-
|
|
755
|
+
handleUpdateBusinesses?: (businessId: number, changes: any) => {},
|
|
734
756
|
}
|
|
735
757
|
|
|
736
758
|
export interface ServiceFormParams {
|
|
@@ -743,13 +765,19 @@ export interface ServiceFormParams {
|
|
|
743
765
|
maxProductQuantity: any,
|
|
744
766
|
businessSlug?: string,
|
|
745
767
|
onClose: any,
|
|
746
|
-
professionalList: any
|
|
768
|
+
professionalList: any,
|
|
769
|
+
productObject?: any,
|
|
770
|
+
professionalListState?: any,
|
|
771
|
+
isCartProduct?: any,
|
|
772
|
+
actionStatus?: any,
|
|
773
|
+
handleCreateGuestUser?: any
|
|
747
774
|
}
|
|
748
775
|
|
|
749
776
|
export interface ProfessionalFilterParams {
|
|
750
777
|
professionals?: any,
|
|
751
778
|
professionalSelected?: any,
|
|
752
|
-
handleChangeProfessionalSelected: any
|
|
779
|
+
handleChangeProfessionalSelected: any,
|
|
780
|
+
handleUpdateProfessionals?: any
|
|
753
781
|
}
|
|
754
782
|
|
|
755
783
|
export interface ProfessionalProfileParams {
|
|
@@ -766,7 +794,8 @@ export interface OrderItAgainParams {
|
|
|
766
794
|
currentCart: any,
|
|
767
795
|
handleUpdateProducts: any,
|
|
768
796
|
navigation: any,
|
|
769
|
-
searchValue?: string
|
|
797
|
+
searchValue?: string,
|
|
798
|
+
businessSingleId?: number | string
|
|
770
799
|
}
|
|
771
800
|
|
|
772
801
|
export interface PreviousProductsOrderedParams {
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useLanguage } from 'ordering-components/native';
|
|
3
3
|
import FontAwesome from 'react-native-vector-icons/FontAwesome';
|
|
4
|
-
import {CODES} from 'ordering-components/native'
|
|
4
|
+
import { CODES } from 'ordering-components/native'
|
|
5
5
|
import { ORDER_TYPES } from '../config/constants';
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
7
|
+
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
8
|
+
|
|
9
|
+
const [languageState, t] = useLanguage();
|
|
10
|
+
const theme = useTheme()
|
|
6
11
|
|
|
7
12
|
export const flatArray = (arr: any) => [].concat(...arr)
|
|
8
13
|
|
|
14
|
+
/**
|
|
15
|
+
* List of order type
|
|
16
|
+
*/
|
|
17
|
+
export const orderTypeList = ['delivery', 'pickup', 'eatin', 'curbside', 'drivethru', 'seatdelivery']
|
|
18
|
+
|
|
9
19
|
/**
|
|
10
20
|
* Function to return the traduction depending of a key 't'
|
|
11
21
|
* @param {string} key for traduction
|
|
@@ -43,69 +53,113 @@ export const getTraduction = (key: string) => {
|
|
|
43
53
|
/**
|
|
44
54
|
* Change local moment variables
|
|
45
55
|
*/
|
|
46
|
-
|
|
56
|
+
export const setLocalMoment = (moment: any, t: any) => {
|
|
47
57
|
moment.locale('custom', {
|
|
48
58
|
months: [
|
|
49
|
-
t('MONTH1','January'),
|
|
50
|
-
t('MONTH2','February'),
|
|
51
|
-
t('MONTH3','March'),
|
|
52
|
-
t('MONTH4','April'),
|
|
53
|
-
t('MONTH5','May'),
|
|
54
|
-
t('MONTH6','June'),
|
|
55
|
-
t('MONTH7','July'),
|
|
56
|
-
t('MONTH8','August'),
|
|
57
|
-
t('MONTH9','September'),
|
|
58
|
-
t('MONTH10','October'),
|
|
59
|
-
t('MONTH11','November'),
|
|
60
|
-
t('MONTH12','December')
|
|
59
|
+
t('MONTH1', 'January'),
|
|
60
|
+
t('MONTH2', 'February'),
|
|
61
|
+
t('MONTH3', 'March'),
|
|
62
|
+
t('MONTH4', 'April'),
|
|
63
|
+
t('MONTH5', 'May'),
|
|
64
|
+
t('MONTH6', 'June'),
|
|
65
|
+
t('MONTH7', 'July'),
|
|
66
|
+
t('MONTH8', 'August'),
|
|
67
|
+
t('MONTH9', 'September'),
|
|
68
|
+
t('MONTH10', 'October'),
|
|
69
|
+
t('MONTH11', 'November'),
|
|
70
|
+
t('MONTH12', 'December')
|
|
61
71
|
],
|
|
62
72
|
monthsShort: [
|
|
63
|
-
t('MONTHSHORT1','Jan'),
|
|
64
|
-
t('MONTHSHORT2','Feb'),
|
|
65
|
-
t('MONTHSHORT3','Mar'),
|
|
66
|
-
t('MONTHSHORT4','Apr'),
|
|
67
|
-
t('MONTHSHORT5','May'),
|
|
68
|
-
t('MONTHSHORT6','Jun'),
|
|
69
|
-
t('MONTHSHORT7','Jul'),
|
|
70
|
-
t('MONTHSHORT8','Aug'),
|
|
71
|
-
t('MONTHSHORT9','Sep'),
|
|
72
|
-
t('MONTHSHORT10','Oct'),
|
|
73
|
-
t('MONTHSHORT11','Nov'),
|
|
74
|
-
t('MONTHSHORT12','Dec')
|
|
73
|
+
t('MONTHSHORT1', 'Jan'),
|
|
74
|
+
t('MONTHSHORT2', 'Feb'),
|
|
75
|
+
t('MONTHSHORT3', 'Mar'),
|
|
76
|
+
t('MONTHSHORT4', 'Apr'),
|
|
77
|
+
t('MONTHSHORT5', 'May'),
|
|
78
|
+
t('MONTHSHORT6', 'Jun'),
|
|
79
|
+
t('MONTHSHORT7', 'Jul'),
|
|
80
|
+
t('MONTHSHORT8', 'Aug'),
|
|
81
|
+
t('MONTHSHORT9', 'Sep'),
|
|
82
|
+
t('MONTHSHORT10', 'Oct'),
|
|
83
|
+
t('MONTHSHORT11', 'Nov'),
|
|
84
|
+
t('MONTHSHORT12', 'Dec')
|
|
75
85
|
],
|
|
76
86
|
weekdays: [
|
|
77
|
-
t('DAY7','Sunday'),
|
|
78
|
-
t('DAY1','Monday'),
|
|
79
|
-
t('DAY2','Tuesday'),
|
|
80
|
-
t('DAY3','Wednesday'),
|
|
81
|
-
t('DAY4','Thursday'),
|
|
82
|
-
t('DAY5','Friday'),
|
|
83
|
-
t('DAY6','Saturday')
|
|
87
|
+
t('DAY7', 'Sunday'),
|
|
88
|
+
t('DAY1', 'Monday'),
|
|
89
|
+
t('DAY2', 'Tuesday'),
|
|
90
|
+
t('DAY3', 'Wednesday'),
|
|
91
|
+
t('DAY4', 'Thursday'),
|
|
92
|
+
t('DAY5', 'Friday'),
|
|
93
|
+
t('DAY6', 'Saturday')
|
|
84
94
|
],
|
|
85
95
|
weekdaysShort: [
|
|
86
|
-
t('DAYSHORT7','Sun'),
|
|
87
|
-
t('DAYSHORT1','Mon'),
|
|
88
|
-
t('DAYSHORT2','Tue'),
|
|
89
|
-
t('DAYSHORT3','Wed'),
|
|
90
|
-
t('DAYSHORT4','Thu'),
|
|
91
|
-
t('DAYSHORT5','Fri'),
|
|
92
|
-
t('DAYSHORT6','Sat')
|
|
96
|
+
t('DAYSHORT7', 'Sun'),
|
|
97
|
+
t('DAYSHORT1', 'Mon'),
|
|
98
|
+
t('DAYSHORT2', 'Tue'),
|
|
99
|
+
t('DAYSHORT3', 'Wed'),
|
|
100
|
+
t('DAYSHORT4', 'Thu'),
|
|
101
|
+
t('DAYSHORT5', 'Fri'),
|
|
102
|
+
t('DAYSHORT6', 'Sat')
|
|
93
103
|
],
|
|
94
104
|
weekdaysMin: [
|
|
95
|
-
t('DAYMIN7','Su'),
|
|
96
|
-
t('DAYMIN1','Mo'),
|
|
97
|
-
t('DAYMIN2','Tu'),
|
|
98
|
-
t('DAYMIN3','We'),
|
|
99
|
-
t('DAYMIN4','Th'),
|
|
100
|
-
t('DAYMIN5','Fr'),
|
|
101
|
-
t('DAYMIN6','Sa')
|
|
105
|
+
t('DAYMIN7', 'Su'),
|
|
106
|
+
t('DAYMIN1', 'Mo'),
|
|
107
|
+
t('DAYMIN2', 'Tu'),
|
|
108
|
+
t('DAYMIN3', 'We'),
|
|
109
|
+
t('DAYMIN4', 'Th'),
|
|
110
|
+
t('DAYMIN5', 'Fr'),
|
|
111
|
+
t('DAYMIN6', 'Sa')
|
|
102
112
|
],
|
|
103
|
-
meridiem
|
|
104
|
-
return hours < 12 ? t('AM', 'AM') : t('PM','PM');
|
|
113
|
+
meridiem: function (hours: any) {
|
|
114
|
+
return hours < 12 ? t('AM', 'AM') : t('PM', 'PM');
|
|
105
115
|
}
|
|
106
116
|
})
|
|
107
117
|
}
|
|
108
118
|
|
|
119
|
+
export const monthsEnum: any = {
|
|
120
|
+
Jan: 'MONTHSHORT1',
|
|
121
|
+
Feb: 'MONTHSHORT2',
|
|
122
|
+
Mar: 'MONTHSHORT3',
|
|
123
|
+
Apr: 'MONTHSHORT4',
|
|
124
|
+
May: 'MONTHSHORT5',
|
|
125
|
+
Jun: 'MONTHSHORT6',
|
|
126
|
+
Jul: 'MONTHSHORT7',
|
|
127
|
+
Aug: 'MONTHSHORT8',
|
|
128
|
+
Sep: 'MONTHSHORT9',
|
|
129
|
+
Oct: 'MONTHSHORT10',
|
|
130
|
+
Nov: 'MONTHSHORT11',
|
|
131
|
+
Dec: 'MONTHSHORT12',
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const locale = {
|
|
135
|
+
name: languageState?.language?.code?.slice(0, 2),
|
|
136
|
+
config: {
|
|
137
|
+
months: [
|
|
138
|
+
t('MONTH1', 'January'),
|
|
139
|
+
t('MONTH2', 'February'),
|
|
140
|
+
t('MONTH3', 'March'),
|
|
141
|
+
t('MONTH4', 'April'),
|
|
142
|
+
t('MONTH5', 'May'),
|
|
143
|
+
t('MONTH6', 'June'),
|
|
144
|
+
t('MONTH7', 'July'),
|
|
145
|
+
t('MONTH8', 'August'),
|
|
146
|
+
t('MONTH9', 'September'),
|
|
147
|
+
t('MONTH10', 'October'),
|
|
148
|
+
t('MONTH11', 'November'),
|
|
149
|
+
t('MONTH12', 'December')
|
|
150
|
+
],
|
|
151
|
+
weekdaysShort: [
|
|
152
|
+
t('DAYSHORT7', 'Sun'),
|
|
153
|
+
t('DAYSHORT1', 'Mon'),
|
|
154
|
+
t('DAYSHORT2', 'Tue'),
|
|
155
|
+
t('DAYSHORT3', 'Wed'),
|
|
156
|
+
t('DAYSHORT4', 'Thu'),
|
|
157
|
+
t('DAYSHORT5', 'Fri'),
|
|
158
|
+
t('DAYSHORT6', 'Sat')
|
|
159
|
+
],
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
109
163
|
/**
|
|
110
164
|
* Function to convert delivery time in minutes
|
|
111
165
|
* @param {string} time business delivery time
|
|
@@ -182,7 +236,7 @@ export const getIconCard = (brand: string, size: number) => {
|
|
|
182
236
|
* Function to return a static google maps image based in location
|
|
183
237
|
* @param {object} param object with latitude and logitude
|
|
184
238
|
*/
|
|
185
|
-
|
|
239
|
+
export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
|
|
186
240
|
return `https://maps.googleapis.com/maps/api/staticmap?size=500x190¢er=${lat},${lng}&zoom=17&scale=2&maptype=roadmap&&markers=icon:https://res.cloudinary.com/ditpjbrmz/image/upload/f_auto,q_auto,w_45,q_auto:best,q_auto:best/v1564675872/marker-customer_kvxric.png%7Ccolor:white%7C${lat},${lng}&key=${apiKey}`
|
|
187
241
|
}
|
|
188
242
|
/**
|
|
@@ -213,8 +267,13 @@ export const sortInputFields = ({ fields, values }: any) => {
|
|
|
213
267
|
return fieldsSorted;
|
|
214
268
|
}
|
|
215
269
|
|
|
216
|
-
export const transformCountryCode = (countryCode
|
|
217
|
-
const code = CODES.find((code
|
|
270
|
+
export const transformCountryCode = (countryCode: number) => {
|
|
271
|
+
const code = CODES.find((code: any) => code.phoneCode === countryCode)
|
|
272
|
+
return code?.countryCode
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export const findExitingCode = (countryCode: string) => {
|
|
276
|
+
const code = CODES.find((code: any) => code.countryCode === (countryCode || '').toUpperCase())
|
|
218
277
|
return code?.countryCode
|
|
219
278
|
}
|
|
220
279
|
|
|
@@ -224,7 +283,7 @@ export const transformCountryCode = (countryCode : number) => {
|
|
|
224
283
|
* @param {*} parser function fallback when is decimal
|
|
225
284
|
* @returns string
|
|
226
285
|
*/
|
|
227
|
-
|
|
286
|
+
export const verifyDecimals = (value: number, parser: any) => {
|
|
228
287
|
if (value % 1 === 0) {
|
|
229
288
|
return value
|
|
230
289
|
} else {
|
|
@@ -240,7 +299,7 @@ export const getTypesText = (value: number) => {
|
|
|
240
299
|
/**
|
|
241
300
|
* List shape for ribbon
|
|
242
301
|
*/
|
|
243
|
-
|
|
302
|
+
export const shape = {
|
|
244
303
|
rectangle: 'rectangle',
|
|
245
304
|
rectangleRound: 'rectangle_round',
|
|
246
305
|
capsuleShape: 'capsule_shape'
|
|
@@ -251,7 +310,7 @@ export const getTypesText = (value: number) => {
|
|
|
251
310
|
* @param {number} value for transform
|
|
252
311
|
*
|
|
253
312
|
*/
|
|
254
|
-
|
|
313
|
+
export const convertToRadian = (value: number) => {
|
|
255
314
|
return value * Math.PI / 180
|
|
256
315
|
}
|
|
257
316
|
|
|
@@ -273,14 +332,14 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
|
|
|
273
332
|
return R * c
|
|
274
333
|
}
|
|
275
334
|
|
|
276
|
-
export const formatUrlVideo = (url
|
|
335
|
+
export const formatUrlVideo = (url: string) => {
|
|
277
336
|
const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
|
|
278
337
|
const match = url.match(regExp)
|
|
279
338
|
const id = (match && match[7].length === 11) ? match[7] : false
|
|
280
339
|
return `https://www.youtube-nocookie.com/embed/${id}`
|
|
281
340
|
}
|
|
282
341
|
|
|
283
|
-
export const formatSeconds = (seconds
|
|
342
|
+
export const formatSeconds = (seconds: number) => {
|
|
284
343
|
// Hours, minutes and seconds
|
|
285
344
|
var hrs = ~~(seconds / 3600)
|
|
286
345
|
var mins = ~~((seconds % 3600) / 60)
|
|
@@ -299,10 +358,268 @@ export const formatSeconds = (seconds : number) => {
|
|
|
299
358
|
/**
|
|
300
359
|
* List of price to filter businesses
|
|
301
360
|
*/
|
|
302
|
-
|
|
361
|
+
export const priceList = [
|
|
303
362
|
{ level: '1', content: '$' },
|
|
304
363
|
{ level: '2', content: '$$' },
|
|
305
364
|
{ level: '3', content: '$$$' },
|
|
306
365
|
{ level: '4', content: '$$$$' },
|
|
307
366
|
{ level: '5', content: '$$$$$' }
|
|
308
367
|
]
|
|
368
|
+
|
|
369
|
+
export const getLogisticTag = (status: any) => {
|
|
370
|
+
const keyList: any = {
|
|
371
|
+
0: t('PENDING', 'Pending'),
|
|
372
|
+
1: t('IN_PROGRESS', 'In progress'),
|
|
373
|
+
2: t('IN_QUEUE', 'In queue'),
|
|
374
|
+
3: t('EXPIRED', 'Expired'),
|
|
375
|
+
4: t('RESOLVED', 'Resolved'),
|
|
376
|
+
}
|
|
377
|
+
return keyList[status] ? keyList[status] : t('UNKNOWN', 'Unknown')
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export const getOrderStatus = (s: string) => {
|
|
381
|
+
const status = parseInt(s);
|
|
382
|
+
const orderStatus = [
|
|
383
|
+
{
|
|
384
|
+
key: 0,
|
|
385
|
+
value: t('PENDING', 'Pending'),
|
|
386
|
+
slug: 'PENDING',
|
|
387
|
+
percentage: 0.1,
|
|
388
|
+
image: theme.images.order.status0,
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
key: 1,
|
|
392
|
+
value: t('COMPLETED', 'Completed'),
|
|
393
|
+
slug: 'COMPLETED',
|
|
394
|
+
percentage: 1,
|
|
395
|
+
image: theme.images.order.status1,
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
key: 2,
|
|
399
|
+
value: t('REJECTED', 'Rejected'),
|
|
400
|
+
slug: 'REJECTED',
|
|
401
|
+
percentage: 0,
|
|
402
|
+
image: theme.images.order.status2,
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
key: 3,
|
|
406
|
+
value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
|
|
407
|
+
slug: 'DRIVER_IN_BUSINESS',
|
|
408
|
+
percentage: 0.6,
|
|
409
|
+
image: theme.images.order.status3,
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
key: 4,
|
|
413
|
+
value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
|
|
414
|
+
slug: 'PREPARATION_COMPLETED',
|
|
415
|
+
percentage: 0.2,
|
|
416
|
+
image: theme.images.order.status4,
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
key: 5,
|
|
420
|
+
value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
|
|
421
|
+
slug: 'REJECTED_BY_BUSINESS',
|
|
422
|
+
percentage: 0,
|
|
423
|
+
image: theme.images.order.status5,
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
key: 6,
|
|
427
|
+
value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
|
|
428
|
+
slug: 'REJECTED_BY_DRIVER',
|
|
429
|
+
percentage: 0,
|
|
430
|
+
image: theme.images.order.status6,
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
key: 7,
|
|
434
|
+
value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
|
|
435
|
+
slug: 'ACCEPTED_BY_BUSINESS',
|
|
436
|
+
percentage: 0.15,
|
|
437
|
+
image: theme.images.order.status7,
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
key: 8,
|
|
441
|
+
value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
|
|
442
|
+
slug: 'ACCEPTED_BY_DRIVER',
|
|
443
|
+
percentage: 0.4,
|
|
444
|
+
image: theme.images.order.status8,
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
key: 9,
|
|
448
|
+
value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
|
|
449
|
+
slug: 'PICK_UP_COMPLETED_BY_DRIVER',
|
|
450
|
+
percentage: 0.7,
|
|
451
|
+
image: theme.images.order.status9,
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
key: 10,
|
|
455
|
+
value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
|
|
456
|
+
slug: 'PICK_UP_FAILED_BY_DRIVER',
|
|
457
|
+
percentage: 0,
|
|
458
|
+
image: theme.images.order.status10,
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
key: 11,
|
|
462
|
+
value: t(
|
|
463
|
+
'DELIVERY_COMPLETED_BY_DRIVER',
|
|
464
|
+
'Delivery completed by driver',
|
|
465
|
+
),
|
|
466
|
+
slug: 'DELIVERY_COMPLETED_BY_DRIVER',
|
|
467
|
+
percentage: 1,
|
|
468
|
+
image: theme.images.order.status11,
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
key: 12,
|
|
472
|
+
value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
|
|
473
|
+
slug: 'DELIVERY_FAILED_BY_DRIVER',
|
|
474
|
+
percentage: 0,
|
|
475
|
+
image: theme.images.order.status12,
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
key: 13,
|
|
479
|
+
value: t('PREORDER', 'PreOrder'),
|
|
480
|
+
slug: 'PREORDER',
|
|
481
|
+
percentage: 0,
|
|
482
|
+
image: theme.images.order.status13,
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
key: 14,
|
|
486
|
+
value: t('ORDER_NOT_READY', 'Order not ready'),
|
|
487
|
+
slug: 'ORDER_NOT_READY',
|
|
488
|
+
percentage: 0.15,
|
|
489
|
+
image: theme.images.order.status13,
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
key: 15,
|
|
493
|
+
value: t(
|
|
494
|
+
'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
495
|
+
'Order picked up completed by customer',
|
|
496
|
+
),
|
|
497
|
+
slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
|
|
498
|
+
percentage: 1,
|
|
499
|
+
image: theme.images.order.status1,
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
key: 16,
|
|
503
|
+
value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
|
|
504
|
+
slug: 'CANCELLED_BY_CUSTOMER',
|
|
505
|
+
percentage: 0,
|
|
506
|
+
image: theme.images.order.status2,
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
key: 17,
|
|
510
|
+
value: t(
|
|
511
|
+
'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
512
|
+
'Order not picked up by customer',
|
|
513
|
+
),
|
|
514
|
+
slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
|
|
515
|
+
percentage: 0,
|
|
516
|
+
image: theme.images.order.status2,
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
key: 18,
|
|
520
|
+
value: t(
|
|
521
|
+
'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
522
|
+
'Driver almost arrived to business',
|
|
523
|
+
),
|
|
524
|
+
slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
|
|
525
|
+
percentage: 0.5,
|
|
526
|
+
image: theme.images.order.status3,
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
key: 19,
|
|
530
|
+
value: t(
|
|
531
|
+
'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
|
|
532
|
+
'Driver almost arrived to customer',
|
|
533
|
+
),
|
|
534
|
+
slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
|
|
535
|
+
percentage: 0.9,
|
|
536
|
+
image: theme.images.order.status11,
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
key: 20,
|
|
540
|
+
value: t(
|
|
541
|
+
'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
542
|
+
'Customer almost arrived to business',
|
|
543
|
+
),
|
|
544
|
+
slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
|
|
545
|
+
percentage: 0.9,
|
|
546
|
+
image: theme.images.order.status7,
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
key: 21,
|
|
550
|
+
value: t(
|
|
551
|
+
'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
552
|
+
'Customer arrived to business',
|
|
553
|
+
),
|
|
554
|
+
slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
|
|
555
|
+
percentage: 0.9,
|
|
556
|
+
image: theme.images.order.status7,
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
key: 22,
|
|
560
|
+
value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
|
|
561
|
+
slug: 'ORDER_LOOKING_FOR_DRIVER',
|
|
562
|
+
percentage: 0.3,
|
|
563
|
+
image: theme.images.order.status8
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
key: 23,
|
|
567
|
+
value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
|
|
568
|
+
slug: 'ORDER_DRIVER_ON_WAY',
|
|
569
|
+
percentage: 0.8,
|
|
570
|
+
image: theme.images.order.status8
|
|
571
|
+
}
|
|
572
|
+
];
|
|
573
|
+
|
|
574
|
+
const objectStatus = orderStatus.find((o) => o.key === status);
|
|
575
|
+
|
|
576
|
+
return objectStatus && objectStatus;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Function to get brightness of color.
|
|
581
|
+
*/
|
|
582
|
+
export const lightenDarkenColor = (color: any) => {
|
|
583
|
+
|
|
584
|
+
let r, g, b, hsp
|
|
585
|
+
if (!color) return
|
|
586
|
+
if (color.match(/^rgb/)) {
|
|
587
|
+
// If HEX --> store the red, green, blue values in separate variables
|
|
588
|
+
color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)
|
|
589
|
+
|
|
590
|
+
r = color[1]
|
|
591
|
+
g = color[2]
|
|
592
|
+
b = color[3]
|
|
593
|
+
} else {
|
|
594
|
+
// If RGB --> Convert it to HEX
|
|
595
|
+
color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'))
|
|
596
|
+
|
|
597
|
+
r = color >> 16
|
|
598
|
+
g = color >> 8 & 255
|
|
599
|
+
b = color & 255
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// HSP (Highly Sensitive Poo) equation
|
|
603
|
+
hsp = Math.sqrt(
|
|
604
|
+
0.299 * (r * r) +
|
|
605
|
+
0.587 * (g * g) +
|
|
606
|
+
0.114 * (b * b)
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
// Using the HSP value, determine whether the color is light or dark
|
|
610
|
+
if (hsp > 197) {
|
|
611
|
+
return true //is light color
|
|
612
|
+
} else {
|
|
613
|
+
return false
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
export const vibrateApp = (impact?: string) => {
|
|
618
|
+
const options = {
|
|
619
|
+
enableVibrateFallback: true,
|
|
620
|
+
ignoreAndroidSystemSettings: false
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
ReactNativeHapticFeedback.trigger(impact || "impactLight", options);
|
|
624
|
+
|
|
625
|
+
}
|