ordering-ui-react-native 0.16.83 → 0.16.84-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 (219) hide show
  1. package/package.json +5 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/styles.tsx +8 -14
  4. package/src/components/BusinessInformation/index.tsx +19 -4
  5. package/src/components/BusinessInformation/styles.tsx +2 -2
  6. package/src/components/BusinessProductsList/index.tsx +10 -10
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/LanguageSelector/index.tsx +21 -16
  9. package/src/components/Messages/index.tsx +2 -2
  10. package/src/components/OrderCreating/index.tsx +1 -21
  11. package/src/components/OrdersOption/index.tsx +54 -56
  12. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  13. package/src/components/SingleProductReview/index.tsx +7 -4
  14. package/src/components/VerifyPhone/styles.tsx +1 -2
  15. package/src/components/shared/OToast.tsx +4 -4
  16. package/src/utils/index.tsx +2 -1
  17. package/themes/business/index.tsx +2 -0
  18. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  19. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  20. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  21. package/themes/business/src/components/Chat/index.tsx +31 -31
  22. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  23. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  24. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  25. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  26. package/themes/business/src/components/LoginForm/index.tsx +236 -80
  27. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  28. package/themes/business/src/components/MapView/index.tsx +19 -8
  29. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  30. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  31. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  32. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  33. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  34. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  35. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  36. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  37. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  38. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  40. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  41. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  44. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  45. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  46. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  47. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  48. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  50. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  51. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  52. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  53. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  54. package/themes/business/src/components/shared/OLink.tsx +33 -13
  55. package/themes/business/src/components/shared/OModal.tsx +16 -9
  56. package/themes/business/src/components/shared/OText.tsx +8 -2
  57. package/themes/business/src/types/index.tsx +35 -3
  58. package/themes/business/src/utils/index.tsx +53 -0
  59. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  61. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  62. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  63. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  64. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  65. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  66. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  67. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  68. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  69. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  70. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  71. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  72. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  73. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  74. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  75. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  76. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  77. package/themes/kiosk/src/types/index.d.ts +13 -0
  78. package/themes/kiosk/src/utils/index.tsx +15 -0
  79. package/themes/original/index.tsx +8 -0
  80. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  81. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  82. package/themes/original/src/components/AddressList/index.tsx +18 -18
  83. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  84. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  85. package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
  86. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  87. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  88. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  89. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  90. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  91. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  92. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  93. package/themes/original/src/components/BusinessListingSearch/index.tsx +102 -155
  94. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  95. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  96. package/themes/original/src/components/BusinessProductsList/index.tsx +11 -8
  97. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  98. package/themes/original/src/components/BusinessProductsListing/index.tsx +564 -495
  99. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  100. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  101. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  103. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  104. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  105. package/themes/original/src/components/Cart/index.tsx +83 -42
  106. package/themes/original/src/components/CartContent/index.tsx +80 -18
  107. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  108. package/themes/original/src/components/Checkout/index.tsx +74 -86
  109. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  110. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  111. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  112. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  113. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  114. package/themes/original/src/components/Favorite/index.tsx +7 -4
  115. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  116. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  117. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  118. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  119. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  120. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  121. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  122. package/themes/original/src/components/Help/index.tsx +8 -8
  123. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  124. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  125. package/themes/original/src/components/HelpGuide/index.tsx +13 -12
  126. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  127. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  128. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  129. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  130. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  131. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  132. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  133. package/themes/original/src/components/LoginForm/index.tsx +28 -8
  134. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  135. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  136. package/themes/original/src/components/Messages/index.tsx +42 -26
  137. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  138. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  139. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  140. package/themes/original/src/components/MultiCheckout/index.tsx +179 -77
  141. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  142. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  143. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  144. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  145. package/themes/original/src/components/NavBar/index.tsx +7 -6
  146. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  147. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  148. package/themes/original/src/components/Notifications/index.tsx +144 -0
  149. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  150. package/themes/original/src/components/OrderDetails/index.tsx +108 -218
  151. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  152. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  153. package/themes/original/src/components/OrderProgress/index.tsx +82 -106
  154. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  155. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  156. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  157. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +93 -97
  158. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  159. package/themes/original/src/components/OrdersOption/index.tsx +83 -91
  160. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  161. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  162. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  163. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  164. package/themes/original/src/components/PaymentOptions/index.tsx +2 -2
  165. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  166. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  167. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  168. package/themes/original/src/components/ProductForm/index.tsx +240 -256
  169. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  170. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  171. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  172. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  173. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  174. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  175. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  176. package/themes/original/src/components/Promotions/index.tsx +234 -220
  177. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  178. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  179. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  180. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  181. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  182. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  183. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  184. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  185. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  186. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  187. package/themes/original/src/components/Sessions/index.tsx +11 -8
  188. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  189. package/themes/original/src/components/SignupForm/index.tsx +78 -66
  190. package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
  191. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  192. package/themes/original/src/components/SingleProductCard/index.tsx +112 -77
  193. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  194. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  195. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  196. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  197. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  198. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  199. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  200. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  201. package/themes/original/src/components/UserFormDetails/index.tsx +50 -54
  202. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  203. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  204. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  205. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  206. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  207. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  208. package/themes/original/src/components/Wallets/index.tsx +177 -164
  209. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  210. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  211. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  212. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  213. package/themes/original/src/components/shared/OButton.tsx +9 -4
  214. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  215. package/themes/original/src/components/shared/OInput.tsx +10 -1
  216. package/themes/original/src/layouts/Container.tsx +13 -9
  217. package/themes/original/src/types/index.tsx +42 -7
  218. package/themes/original/src/utils/index.tsx +321 -58
  219. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -47,6 +47,8 @@ export interface ProfileParams {
47
47
  isVerifiedPhone?: any;
48
48
  handleRemoveAccount?: any;
49
49
  removeAccountState?: any;
50
+ handleChangePromotions?: any;
51
+ notificationsGroup?: any;
50
52
  }
51
53
 
52
54
  export interface AddressListParams {
@@ -80,6 +82,7 @@ export interface AddressFormParams {
80
82
  saveAddress?: any,
81
83
  userCustomerSetup?: boolean,
82
84
  isRequiredField?: (field: string) => {},
85
+ showField?: (field: string) => {},
83
86
  isGuestUser?: boolean,
84
87
  useValidationFileds?: boolean,
85
88
  isSelectedAfterAdd?: boolean,
@@ -115,6 +118,7 @@ export interface SignupParams {
115
118
  useSignUpOtpEmail?: boolean;
116
119
  useSignUpOtpCellphone?: boolean;
117
120
  willVerifyOtpState?: boolean;
121
+ isGuest?: any;
118
122
  numOtpInputs?: number;
119
123
  handleChangePromotions: () => void;
120
124
  handleChangeInput?: (in1: any, in2: any) => void;
@@ -170,6 +174,9 @@ export interface BusinessesListingParams {
170
174
  handleChangePriceLevel?: any;
171
175
  businessTypeSelected?: any;
172
176
  logosLayout?: boolean;
177
+ isCustomLayout?: boolean;
178
+ citiesState?: any;
179
+ actualSlug?: any;
173
180
  }
174
181
  export interface HighestRatedBusinessesParams {
175
182
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
@@ -215,6 +222,9 @@ export interface BusinessControllerParams {
215
222
  setFavoriteIds?: any;
216
223
  handleUpdateBusinessList?: any;
217
224
  enableIntersection?: boolean;
225
+ isCustomLayout?: boolean;
226
+ getBusinessOffer?: any;
227
+ handleCustomUpdate?: (businessId: number, changes: any) => {};
218
228
  }
219
229
  export interface BusinessProductsListingParams {
220
230
  navigation?: any;
@@ -240,6 +250,9 @@ export interface BusinessProductsListingParams {
240
250
  handleUpdateProducts?: any;
241
251
  professionalSelected?: any;
242
252
  handleChangeProfessionalSelected?: any;
253
+ handleUpdateProfessionals?: any;
254
+ onBusinessClick?: any;
255
+ onNavigationRedirect?: any;
243
256
  }
244
257
  export interface BusinessBasicInformationParams {
245
258
  navigation?: any;
@@ -305,6 +318,7 @@ export interface SingleProductCardParams {
305
318
  enableIntersection?: boolean;
306
319
  navigation?: any;
307
320
  isPreviously?: any;
321
+ isProductId?: any;
308
322
  }
309
323
  export interface BusinessInformationParams {
310
324
  navigation?: any,
@@ -359,6 +373,8 @@ export interface OrdersOptionParams {
359
373
  refreshOrders?: boolean,
360
374
  setRefreshOrders?: (value: boolean) => void,
361
375
  handleUpdateOrderList?: (orderId: number, changes: any) => {},
376
+ handleUpdateProducts?: (productId: number, changes: any) => {},
377
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
362
378
  isBusiness?: boolean,
363
379
  isProducts?: boolean,
364
380
  businessOrderIds?: any,
@@ -366,6 +382,8 @@ export interface OrdersOptionParams {
366
382
  businessesSearchList?: any,
367
383
  hideOrders?: boolean,
368
384
  BusinessControllerSkeletons?: any,
385
+ businessPaginationProps?: any,
386
+ businesses?: any
369
387
  }
370
388
  export interface ActiveOrdersParams {
371
389
  orders?: any,
@@ -387,6 +405,7 @@ export interface PreviousOrdersParams {
387
405
  getOrderStatus?: any,
388
406
  orderID?: number
389
407
  reorderLoading?: boolean,
408
+ loading?: boolean,
390
409
  loadMoreOrders?: () => {},
391
410
  handleReorder?: (orderId: number) => {},
392
411
  onNavigationRedirect?: (route: string, params?: any) => {}
@@ -518,6 +537,7 @@ export interface FloatingButtonParams {
518
537
  }
519
538
  export interface MomentOptionParams {
520
539
  navigation: any;
540
+ isCart?: any;
521
541
  nopadding?: boolean;
522
542
  datesList: Array<any>;
523
543
  hoursList: Array<any>;
@@ -564,7 +584,7 @@ export interface UpsellingProductsParams {
564
584
  business?: any;
565
585
  businessId?: number;
566
586
  cartProducts?: Array<any>;
567
- handleUpsellingPage: () => void;
587
+ handleUpsellingPage: (cart ?: any) => void;
568
588
  openUpselling: boolean;
569
589
  canOpenUpselling?: boolean;
570
590
  setCanOpenUpselling?: (value: any) => void;
@@ -575,6 +595,8 @@ export interface UpsellingProductsParams {
575
595
  products?: any;
576
596
  onNavigationRedirect?: any;
577
597
  onGoBack?: any;
598
+ singleBusiness?: any;
599
+ isFranchiseApp?: any;
578
600
  }
579
601
 
580
602
  export interface GoogleMapsParams {
@@ -635,6 +657,7 @@ export interface BusinessSearchParams {
635
657
  onNavigationRedirect?: any,
636
658
  handleUpdateProducts: any,
637
659
  handleUpdateBusinessList?: any;
660
+ brandId?: number
638
661
  }
639
662
 
640
663
  export interface NoNetworkParams {
@@ -648,14 +671,15 @@ export interface PlaceSpotParams {
648
671
  spotNumberDefault?: any,
649
672
  vehicleDefault?: any,
650
673
  spotNumber?: any,
651
- setSpotNumber?: any,
674
+ setSpotNumber?: any,
652
675
  orderTypes?: any,
653
676
  placesState?: any,
654
- handleChangePlace? : any,
677
+ handleChangePlace?: any,
655
678
  spotState?: any,
656
679
  vehicle?: any,
657
680
  setVehicle?: any,
658
681
  handleChangeSpot?: any
682
+ setPlaceSpotNumber?: any
659
683
  }
660
684
 
661
685
  export interface PromotionParams {
@@ -719,7 +743,9 @@ export interface PreviousBusinessOrderedParams {
719
743
  businessId?: number,
720
744
  onNavigationRedirect?: any,
721
745
  isBusinessesSearchList?: any,
722
- businessLoading?: boolean
746
+ businessLoading?: boolean,
747
+ businesses?: any
748
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
723
749
  }
724
750
 
725
751
  export interface ServiceFormParams {
@@ -732,13 +758,19 @@ export interface ServiceFormParams {
732
758
  maxProductQuantity: any,
733
759
  businessSlug?: string,
734
760
  onClose: any,
735
- professionalList: any
761
+ professionalList: any,
762
+ productObject?: any,
763
+ professionalListState?: any,
764
+ isCartProduct?: any,
765
+ actionStatus?: any,
766
+ handleCreateGuestUser?: any
736
767
  }
737
768
 
738
769
  export interface ProfessionalFilterParams {
739
770
  professionals?: any,
740
771
  professionalSelected?: any,
741
- handleChangeProfessionalSelected: any
772
+ handleChangeProfessionalSelected: any,
773
+ handleUpdateProfessionals?: any
742
774
  }
743
775
 
744
776
  export interface ProfessionalProfileParams {
@@ -754,11 +786,14 @@ export interface OrderItAgainParams {
754
786
  categoryState: any,
755
787
  currentCart: any,
756
788
  handleUpdateProducts: any,
757
- navigation: any
789
+ navigation: any,
790
+ searchValue?: string
758
791
  }
759
792
 
760
793
  export interface PreviousProductsOrderedParams {
761
794
  products?: any,
795
+ isProductId?: boolean
762
796
  onProductClick?: any,
763
797
  isBusinessesSearchList?: boolean
798
+ handleUpdateProducts?: any
764
799
  }
@@ -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,8 @@ 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)
218
271
  return code?.countryCode
219
272
  }
220
273
 
@@ -224,7 +277,7 @@ export const transformCountryCode = (countryCode : number) => {
224
277
  * @param {*} parser function fallback when is decimal
225
278
  * @returns string
226
279
  */
227
- export const verifyDecimals = (value: number, parser: any) => {
280
+ export const verifyDecimals = (value: number, parser: any) => {
228
281
  if (value % 1 === 0) {
229
282
  return value
230
283
  } else {
@@ -240,7 +293,7 @@ export const getTypesText = (value: number) => {
240
293
  /**
241
294
  * List shape for ribbon
242
295
  */
243
- export const shape = {
296
+ export const shape = {
244
297
  rectangle: 'rectangle',
245
298
  rectangleRound: 'rectangle_round',
246
299
  capsuleShape: 'capsule_shape'
@@ -251,7 +304,7 @@ export const getTypesText = (value: number) => {
251
304
  * @param {number} value for transform
252
305
  *
253
306
  */
254
- export const convertToRadian = (value: number) => {
307
+ export const convertToRadian = (value: number) => {
255
308
  return value * Math.PI / 180
256
309
  }
257
310
 
@@ -273,14 +326,14 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
273
326
  return R * c
274
327
  }
275
328
 
276
- export const formatUrlVideo = (url : string) => {
329
+ export const formatUrlVideo = (url: string) => {
277
330
  const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
278
331
  const match = url.match(regExp)
279
332
  const id = (match && match[7].length === 11) ? match[7] : false
280
333
  return `https://www.youtube-nocookie.com/embed/${id}`
281
334
  }
282
335
 
283
- export const formatSeconds = (seconds : number) => {
336
+ export const formatSeconds = (seconds: number) => {
284
337
  // Hours, minutes and seconds
285
338
  var hrs = ~~(seconds / 3600)
286
339
  var mins = ~~((seconds % 3600) / 60)
@@ -299,10 +352,220 @@ export const formatSeconds = (seconds : number) => {
299
352
  /**
300
353
  * List of price to filter businesses
301
354
  */
302
- export const priceList = [
355
+ export const priceList = [
303
356
  { level: '1', content: '$' },
304
357
  { level: '2', content: '$$' },
305
358
  { level: '3', content: '$$$' },
306
359
  { level: '4', content: '$$$$' },
307
360
  { level: '5', content: '$$$$$' }
308
361
  ]
362
+
363
+ export const getLogisticTag = (status: any) => {
364
+ const keyList: any = {
365
+ 0: t('PENDING', 'Pending'),
366
+ 1: t('IN_PROGRESS', 'In progress'),
367
+ 2: t('IN_QUEUE', 'In queue'),
368
+ 3: t('EXPIRED', 'Expired'),
369
+ 4: t('RESOLVED', 'Resolved'),
370
+ }
371
+ return keyList[status] ? keyList[status] : t('UNKNOWN', 'Unknown')
372
+ }
373
+
374
+ export const getOrderStatus = (s: string) => {
375
+ const status = parseInt(s);
376
+ const orderStatus = [
377
+ {
378
+ key: 0,
379
+ value: t('PENDING', 'Pending'),
380
+ slug: 'PENDING',
381
+ percentage: 0.25,
382
+ image: theme.images.order.status0,
383
+ },
384
+ {
385
+ key: 1,
386
+ value: t('COMPLETED', 'Completed'),
387
+ slug: 'COMPLETED',
388
+ percentage: 1,
389
+ image: theme.images.order.status1,
390
+ },
391
+ {
392
+ key: 2,
393
+ value: t('REJECTED', 'Rejected'),
394
+ slug: 'REJECTED',
395
+ percentage: 0,
396
+ image: theme.images.order.status2,
397
+ },
398
+ {
399
+ key: 3,
400
+ value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
401
+ slug: 'DRIVER_IN_BUSINESS',
402
+ percentage: 0.6,
403
+ image: theme.images.order.status3,
404
+ },
405
+ {
406
+ key: 4,
407
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
408
+ slug: 'PREPARATION_COMPLETED',
409
+ percentage: 0.7,
410
+ image: theme.images.order.status4,
411
+ },
412
+ {
413
+ key: 5,
414
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
415
+ slug: 'REJECTED_BY_BUSINESS',
416
+ percentage: 0,
417
+ image: theme.images.order.status5,
418
+ },
419
+ {
420
+ key: 6,
421
+ value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
422
+ slug: 'REJECTED_BY_DRIVER',
423
+ percentage: 0,
424
+ image: theme.images.order.status6,
425
+ },
426
+ {
427
+ key: 7,
428
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
429
+ slug: 'ACCEPTED_BY_BUSINESS',
430
+ percentage: 0.35,
431
+ image: theme.images.order.status7,
432
+ },
433
+ {
434
+ key: 8,
435
+ value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
436
+ slug: 'ACCEPTED_BY_DRIVER',
437
+ percentage: 0.45,
438
+ image: theme.images.order.status8,
439
+ },
440
+ {
441
+ key: 9,
442
+ value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
443
+ slug: 'PICK_UP_COMPLETED_BY_DRIVER',
444
+ percentage: 0.8,
445
+ image: theme.images.order.status9,
446
+ },
447
+ {
448
+ key: 10,
449
+ value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
450
+ slug: 'PICK_UP_FAILED_BY_DRIVER',
451
+ percentage: 0,
452
+ image: theme.images.order.status10,
453
+ },
454
+ {
455
+ key: 11,
456
+ value: t(
457
+ 'DELIVERY_COMPLETED_BY_DRIVER',
458
+ 'Delivery completed by driver',
459
+ ),
460
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
461
+ percentage: 1,
462
+ image: theme.images.order.status11,
463
+ },
464
+ {
465
+ key: 12,
466
+ value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
467
+ slug: 'DELIVERY_FAILED_BY_DRIVER',
468
+ percentage: 0,
469
+ image: theme.images.order.status12,
470
+ },
471
+ {
472
+ key: 13,
473
+ value: t('PREORDER', 'PreOrder'),
474
+ slug: 'PREORDER',
475
+ percentage: 0,
476
+ image: theme.images.order.status13,
477
+ },
478
+ {
479
+ key: 14,
480
+ value: t('ORDER_NOT_READY', 'Order not ready'),
481
+ slug: 'ORDER_NOT_READY',
482
+ percentage: 0,
483
+ image: theme.images.order.status13,
484
+ },
485
+ {
486
+ key: 15,
487
+ value: t(
488
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
489
+ 'Order picked up completed by customer',
490
+ ),
491
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
492
+ percentage: 100,
493
+ image: theme.images.order.status1,
494
+ },
495
+ {
496
+ key: 16,
497
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
498
+ slug: 'CANCELLED_BY_CUSTOMER',
499
+ percentage: 0,
500
+ image: theme.images.order.status2,
501
+ },
502
+ {
503
+ key: 17,
504
+ value: t(
505
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
506
+ 'Order not picked up by customer',
507
+ ),
508
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
509
+ percentage: 0,
510
+ image: theme.images.order.status2,
511
+ },
512
+ {
513
+ key: 18,
514
+ value: t(
515
+ 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
516
+ 'Driver almost arrived to business',
517
+ ),
518
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
519
+ percentage: 0.15,
520
+ image: theme.images.order.status3,
521
+ },
522
+ {
523
+ key: 19,
524
+ value: t(
525
+ 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
526
+ 'Driver almost arrived to customer',
527
+ ),
528
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
529
+ percentage: 0.9,
530
+ image: theme.images.order.status11,
531
+ },
532
+ {
533
+ key: 20,
534
+ value: t(
535
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
536
+ 'Customer almost arrived to business',
537
+ ),
538
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
539
+ percentage: 90,
540
+ image: theme.images.order.status7,
541
+ },
542
+ {
543
+ key: 21,
544
+ value: t(
545
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
546
+ 'Customer arrived to business',
547
+ ),
548
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
549
+ percentage: 95,
550
+ image: theme.images.order.status7,
551
+ },
552
+ {
553
+ key: 22,
554
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
555
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
556
+ percentage: 35,
557
+ image: theme.images.order.status8
558
+ },
559
+ {
560
+ key: 23,
561
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
562
+ slug: 'ORDER_DRIVER_ON_WAY',
563
+ percentage: 45,
564
+ image: theme.images.order.status8
565
+ }
566
+ ];
567
+
568
+ const objectStatus = orderStatus.find((o) => o.key === status);
569
+
570
+ return objectStatus && objectStatus;
571
+ }
@@ -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}>