ordering-ui-react-native 0.16.89 → 0.16.90-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 (216) 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 +1 -1
  7. package/src/components/BusinessesListing/index.tsx +1 -1
  8. package/src/components/OrderCreating/index.tsx +1 -21
  9. package/src/components/OrdersOption/index.tsx +54 -56
  10. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  11. package/src/components/SingleProductReview/index.tsx +7 -4
  12. package/src/components/VerifyPhone/styles.tsx +1 -2
  13. package/src/components/shared/OToast.tsx +4 -4
  14. package/src/utils/index.tsx +2 -1
  15. package/themes/business/index.tsx +2 -0
  16. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  17. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  18. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  19. package/themes/business/src/components/Chat/index.tsx +31 -31
  20. package/themes/business/src/components/DriverMap/index.tsx +22 -9
  21. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  22. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  23. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  24. package/themes/business/src/components/LoginForm/index.tsx +239 -80
  25. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  26. package/themes/business/src/components/MapView/index.tsx +18 -7
  27. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  28. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  29. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  30. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +96 -50
  31. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  32. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  33. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  34. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  35. package/themes/business/src/components/OrdersOption/index.tsx +79 -87
  36. package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
  37. package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
  38. package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
  39. package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
  40. package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
  41. package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
  42. package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
  43. package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
  44. package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
  45. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  46. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  47. package/themes/business/src/components/PreviousOrders/index.tsx +447 -247
  48. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  49. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  50. package/themes/business/src/components/ReviewCustomer/index.tsx +54 -27
  51. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  52. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  53. package/themes/business/src/components/shared/OLink.tsx +33 -13
  54. package/themes/business/src/components/shared/OModal.tsx +16 -9
  55. package/themes/business/src/components/shared/OText.tsx +8 -2
  56. package/themes/business/src/types/index.tsx +35 -3
  57. package/themes/business/src/utils/index.tsx +53 -0
  58. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  59. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  60. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  62. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  63. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  64. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  65. package/themes/kiosk/src/components/LoginForm/index.tsx +473 -151
  66. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  67. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  68. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  69. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  70. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  71. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  72. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  73. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  74. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  75. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  76. package/themes/kiosk/src/types/index.d.ts +13 -0
  77. package/themes/kiosk/src/utils/index.tsx +15 -0
  78. package/themes/original/index.tsx +8 -0
  79. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  80. package/themes/original/src/components/AddressForm/index.tsx +155 -139
  81. package/themes/original/src/components/AddressList/index.tsx +27 -22
  82. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  83. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  84. package/themes/original/src/components/BusinessBasicInformation/index.tsx +118 -76
  85. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +1 -4
  86. package/themes/original/src/components/BusinessController/index.tsx +100 -47
  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 +9 -3
  90. package/themes/original/src/components/BusinessListingSearch/index.tsx +86 -33
  91. package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
  92. package/themes/original/src/components/BusinessPreorder/index.tsx +96 -15
  93. package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
  94. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  95. package/themes/original/src/components/BusinessProductsListing/index.tsx +567 -495
  96. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  97. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  98. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  99. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
  100. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  101. package/themes/original/src/components/BusinessesListing/index.tsx +6 -6
  102. package/themes/original/src/components/Cart/index.tsx +87 -42
  103. package/themes/original/src/components/CartContent/index.tsx +77 -15
  104. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  105. package/themes/original/src/components/Checkout/index.tsx +281 -174
  106. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  107. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  108. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  109. package/themes/original/src/components/DriverTips/index.tsx +52 -37
  110. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  111. package/themes/original/src/components/Favorite/index.tsx +7 -4
  112. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  113. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  114. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  115. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  116. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  117. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  118. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  119. package/themes/original/src/components/Help/index.tsx +8 -8
  120. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +11 -22
  121. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  122. package/themes/original/src/components/HelpGuide/index.tsx +12 -16
  123. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpOrder/index.tsx +12 -25
  125. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  126. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  127. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  128. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  129. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  130. package/themes/original/src/components/LoginForm/index.tsx +43 -19
  131. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  132. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  133. package/themes/original/src/components/Messages/index.tsx +31 -10
  134. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  135. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  136. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  137. package/themes/original/src/components/MultiCheckout/index.tsx +204 -79
  138. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  139. package/themes/original/src/components/MultiOrdersDetails/index.tsx +67 -20
  140. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  141. package/themes/original/src/components/MyOrders/index.tsx +66 -17
  142. package/themes/original/src/components/NavBar/index.tsx +6 -11
  143. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  144. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  145. package/themes/original/src/components/Notifications/index.tsx +144 -0
  146. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  147. package/themes/original/src/components/OrderDetails/OrderEta.tsx +59 -0
  148. package/themes/original/src/components/OrderDetails/index.tsx +110 -221
  149. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  150. package/themes/original/src/components/OrderItAgain/index.tsx +44 -42
  151. package/themes/original/src/components/OrderProgress/index.tsx +74 -112
  152. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  153. package/themes/original/src/components/OrderSummary/index.tsx +52 -17
  154. package/themes/original/src/components/OrderTypeSelector/index.tsx +9 -3
  155. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +29 -20
  156. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  157. package/themes/original/src/components/OrdersOption/index.tsx +76 -83
  158. package/themes/original/src/components/PageBanner/index.tsx +146 -0
  159. package/themes/original/src/components/PageBanner/styles.tsx +11 -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 +2 -2
  163. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  164. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  165. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  166. package/themes/original/src/components/ProductForm/index.tsx +240 -256
  167. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  168. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  169. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  170. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  171. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  172. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
  173. package/themes/original/src/components/ProfessionalProfile/index.tsx +54 -14
  174. package/themes/original/src/components/Promotions/index.tsx +234 -220
  175. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  176. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  177. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  178. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  179. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  180. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  181. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  182. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  183. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  184. package/themes/original/src/components/ServiceForm/index.tsx +377 -270
  185. package/themes/original/src/components/Sessions/index.tsx +11 -8
  186. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  187. package/themes/original/src/components/SignupForm/index.tsx +79 -67
  188. package/themes/original/src/components/SingleOrderCard/index.tsx +126 -57
  189. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  190. package/themes/original/src/components/SingleProductCard/index.tsx +104 -45
  191. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  192. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  193. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  194. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  195. package/themes/original/src/components/StripeElementsForm/index.tsx +4 -1
  196. package/themes/original/src/components/UpsellingProducts/index.tsx +237 -218
  197. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  198. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  199. package/themes/original/src/components/UserFormDetails/index.tsx +53 -54
  200. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  201. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  202. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  203. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  204. package/themes/original/src/components/Wallets/index.tsx +96 -93
  205. package/themes/original/src/components/Wallets/styles.tsx +2 -0
  206. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  207. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  208. package/themes/original/src/components/shared/OBottomPopup.tsx +1 -1
  209. package/themes/original/src/components/shared/OButton.tsx +6 -2
  210. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  211. package/themes/original/src/components/shared/OInput.tsx +10 -1
  212. package/themes/original/src/components/shared/OModal.tsx +3 -3
  213. package/themes/original/src/layouts/Container.tsx +13 -9
  214. package/themes/original/src/types/index.tsx +37 -5
  215. package/themes/original/src/utils/index.tsx +321 -58
  216. 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,
@@ -47,6 +48,8 @@ export interface ProfileParams {
47
48
  isVerifiedPhone?: any;
48
49
  handleRemoveAccount?: any;
49
50
  removeAccountState?: any;
51
+ handleChangePromotions?: any;
52
+ notificationsGroup?: any;
50
53
  }
51
54
 
52
55
  export interface AddressListParams {
@@ -80,6 +83,7 @@ export interface AddressFormParams {
80
83
  saveAddress?: any,
81
84
  userCustomerSetup?: boolean,
82
85
  isRequiredField?: (field: string) => {},
86
+ showField?: (field: string) => {},
83
87
  isGuestUser?: boolean,
84
88
  useValidationFileds?: boolean,
85
89
  isSelectedAfterAdd?: boolean,
@@ -115,6 +119,7 @@ export interface SignupParams {
115
119
  useSignUpOtpEmail?: boolean;
116
120
  useSignUpOtpCellphone?: boolean;
117
121
  willVerifyOtpState?: boolean;
122
+ isGuest?: any;
118
123
  numOtpInputs?: number;
119
124
  handleChangePromotions: () => void;
120
125
  handleChangeInput?: (in1: any, in2: any) => void;
@@ -170,6 +175,9 @@ export interface BusinessesListingParams {
170
175
  handleChangePriceLevel?: any;
171
176
  businessTypeSelected?: any;
172
177
  logosLayout?: boolean;
178
+ isCustomLayout?: boolean;
179
+ citiesState?: any;
180
+ actualSlug?: any;
173
181
  }
174
182
  export interface HighestRatedBusinessesParams {
175
183
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
@@ -215,6 +223,9 @@ export interface BusinessControllerParams {
215
223
  setFavoriteIds?: any;
216
224
  handleUpdateBusinessList?: any;
217
225
  enableIntersection?: boolean;
226
+ isCustomLayout?: boolean;
227
+ getBusinessOffer?: any;
228
+ handleCustomUpdate?: (businessId: number, changes: any) => {};
218
229
  }
219
230
  export interface BusinessProductsListingParams {
220
231
  navigation?: any;
@@ -240,6 +251,9 @@ export interface BusinessProductsListingParams {
240
251
  handleUpdateProducts?: any;
241
252
  professionalSelected?: any;
242
253
  handleChangeProfessionalSelected?: any;
254
+ handleUpdateProfessionals?: any;
255
+ onBusinessClick?: any;
256
+ onNavigationRedirect?: any;
243
257
  }
244
258
  export interface BusinessBasicInformationParams {
245
259
  navigation?: any;
@@ -305,6 +319,7 @@ export interface SingleProductCardParams {
305
319
  enableIntersection?: boolean;
306
320
  navigation?: any;
307
321
  isPreviously?: any;
322
+ isProductId?: any;
308
323
  }
309
324
  export interface BusinessInformationParams {
310
325
  navigation?: any,
@@ -359,6 +374,8 @@ export interface OrdersOptionParams {
359
374
  refreshOrders?: boolean,
360
375
  setRefreshOrders?: (value: boolean) => void,
361
376
  handleUpdateOrderList?: (orderId: number, changes: any) => {},
377
+ handleUpdateProducts?: (productId: number, changes: any) => {},
378
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
362
379
  isBusiness?: boolean,
363
380
  isProducts?: boolean,
364
381
  businessOrderIds?: any,
@@ -389,6 +406,7 @@ export interface PreviousOrdersParams {
389
406
  getOrderStatus?: any,
390
407
  orderID?: number
391
408
  reorderLoading?: boolean,
409
+ loading?: boolean,
392
410
  loadMoreOrders?: () => {},
393
411
  handleReorder?: (orderId: number) => {},
394
412
  onNavigationRedirect?: (route: string, params?: any) => {}
@@ -520,6 +538,7 @@ export interface FloatingButtonParams {
520
538
  }
521
539
  export interface MomentOptionParams {
522
540
  navigation: any;
541
+ isCart?: any;
523
542
  nopadding?: boolean;
524
543
  datesList: Array<any>;
525
544
  hoursList: Array<any>;
@@ -566,7 +585,7 @@ export interface UpsellingProductsParams {
566
585
  business?: any;
567
586
  businessId?: number;
568
587
  cartProducts?: Array<any>;
569
- handleUpsellingPage: () => void;
588
+ handleUpsellingPage: (cart ?: any) => void;
570
589
  openUpselling: boolean;
571
590
  canOpenUpselling?: boolean;
572
591
  setCanOpenUpselling?: (value: any) => void;
@@ -577,6 +596,8 @@ export interface UpsellingProductsParams {
577
596
  products?: any;
578
597
  onNavigationRedirect?: any;
579
598
  onGoBack?: any;
599
+ singleBusiness?: any;
600
+ isFranchiseApp?: any;
580
601
  }
581
602
 
582
603
  export interface GoogleMapsParams {
@@ -637,6 +658,7 @@ export interface BusinessSearchParams {
637
658
  onNavigationRedirect?: any,
638
659
  handleUpdateProducts: any,
639
660
  handleUpdateBusinessList?: any;
661
+ brandId?: number
640
662
  }
641
663
 
642
664
  export interface NoNetworkParams {
@@ -650,14 +672,15 @@ export interface PlaceSpotParams {
650
672
  spotNumberDefault?: any,
651
673
  vehicleDefault?: any,
652
674
  spotNumber?: any,
653
- setSpotNumber?: any,
675
+ setSpotNumber?: any,
654
676
  orderTypes?: any,
655
677
  placesState?: any,
656
- handleChangePlace? : any,
678
+ handleChangePlace?: any,
657
679
  spotState?: any,
658
680
  vehicle?: any,
659
681
  setVehicle?: any,
660
682
  handleChangeSpot?: any
683
+ setPlaceSpotNumber?: any
661
684
  }
662
685
 
663
686
  export interface PromotionParams {
@@ -723,6 +746,7 @@ export interface PreviousBusinessOrderedParams {
723
746
  isBusinessesSearchList?: any,
724
747
  businessLoading?: boolean,
725
748
  businesses?: any
749
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
726
750
  }
727
751
 
728
752
  export interface ServiceFormParams {
@@ -735,13 +759,19 @@ export interface ServiceFormParams {
735
759
  maxProductQuantity: any,
736
760
  businessSlug?: string,
737
761
  onClose: any,
738
- professionalList: any
762
+ professionalList: any,
763
+ productObject?: any,
764
+ professionalListState?: any,
765
+ isCartProduct?: any,
766
+ actionStatus?: any,
767
+ handleCreateGuestUser?: any
739
768
  }
740
769
 
741
770
  export interface ProfessionalFilterParams {
742
771
  professionals?: any,
743
772
  professionalSelected?: any,
744
- handleChangeProfessionalSelected: any
773
+ handleChangeProfessionalSelected: any,
774
+ handleUpdateProfessionals?: any
745
775
  }
746
776
 
747
777
  export interface ProfessionalProfileParams {
@@ -763,6 +793,8 @@ export interface OrderItAgainParams {
763
793
 
764
794
  export interface PreviousProductsOrderedParams {
765
795
  products?: any,
796
+ isProductId?: boolean
766
797
  onProductClick?: any,
767
798
  isBusinessesSearchList?: boolean
799
+ handleUpdateProducts?: any
768
800
  }
@@ -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}>