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