ordering-ui-react-native 0.16.73 → 0.16.74-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 +6 -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/Checkout/index.tsx +2 -1
  9. package/src/components/LanguageSelector/index.tsx +21 -16
  10. package/src/components/Messages/index.tsx +2 -2
  11. package/src/components/OrderCreating/index.tsx +2 -2
  12. package/src/components/OrdersOption/index.tsx +54 -56
  13. package/src/components/PaymentOptions/index.tsx +298 -345
  14. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  15. package/src/components/SingleProductReview/index.tsx +7 -4
  16. package/src/components/StripeElementsForm/index.tsx +25 -16
  17. package/src/components/VerifyPhone/styles.tsx +1 -2
  18. package/src/components/shared/OToast.tsx +4 -4
  19. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  20. package/src/utils/index.tsx +2 -1
  21. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  22. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  23. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  24. package/themes/business/src/components/Chat/index.tsx +31 -31
  25. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  26. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  27. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  28. package/themes/business/src/components/LoginForm/index.tsx +332 -140
  29. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  30. package/themes/business/src/components/MapView/index.tsx +14 -3
  31. package/themes/business/src/components/MessagesOption/index.tsx +11 -1
  32. package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
  33. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
  34. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
  35. package/themes/business/src/components/OrdersOption/index.tsx +63 -73
  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 +440 -245
  48. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  49. package/themes/business/src/components/ProductItemAccordion/index.tsx +24 -5
  50. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  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/OText.tsx +8 -2
  55. package/themes/business/src/types/index.tsx +29 -3
  56. package/themes/business/src/utils/index.tsx +26 -0
  57. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  58. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  59. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  60. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  61. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  62. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  63. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  64. package/themes/kiosk/src/components/LoginForm/index.tsx +545 -112
  65. package/themes/kiosk/src/components/LoginForm/styles.tsx +18 -0
  66. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  67. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  68. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  69. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
  70. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  71. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  72. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  73. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  74. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  75. package/themes/kiosk/src/types/index.d.ts +15 -0
  76. package/themes/kiosk/src/utils/index.tsx +15 -0
  77. package/themes/original/index.tsx +6 -0
  78. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  79. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  80. package/themes/original/src/components/AddressList/index.tsx +18 -18
  81. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  82. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  83. package/themes/original/src/components/BusinessBasicInformation/index.tsx +47 -22
  84. package/themes/original/src/components/BusinessController/index.tsx +101 -70
  85. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  86. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  87. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  88. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  89. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  90. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  91. package/themes/original/src/components/BusinessListingSearch/index.tsx +105 -156
  92. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  93. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  94. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  95. package/themes/original/src/components/BusinessProductsList/index.tsx +41 -62
  96. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  97. package/themes/original/src/components/BusinessProductsListing/index.tsx +561 -496
  98. package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
  99. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  100. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  101. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +83 -80
  102. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  103. package/themes/original/src/components/BusinessesListing/index.tsx +7 -6
  104. package/themes/original/src/components/Cart/index.tsx +76 -42
  105. package/themes/original/src/components/CartContent/index.tsx +80 -18
  106. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  107. package/themes/original/src/components/Checkout/index.tsx +96 -108
  108. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  109. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  110. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  111. package/themes/original/src/components/DriverTips/index.tsx +47 -37
  112. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  113. package/themes/original/src/components/Favorite/index.tsx +7 -4
  114. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  115. package/themes/original/src/components/FavoriteList/index.tsx +70 -80
  116. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  117. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  118. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  119. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  120. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  121. package/themes/original/src/components/Help/index.tsx +8 -8
  122. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
  123. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
  124. package/themes/original/src/components/HelpGuide/index.tsx +13 -12
  125. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  126. package/themes/original/src/components/HelpOrder/index.tsx +12 -20
  127. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  128. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  129. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  130. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  131. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  132. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  133. package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
  134. package/themes/original/src/components/MessageListing/index.tsx +7 -40
  135. package/themes/original/src/components/Messages/index.tsx +42 -26
  136. package/themes/original/src/components/MomentOption/index.tsx +23 -14
  137. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  138. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  139. package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
  140. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  141. package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
  142. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  143. package/themes/original/src/components/MyOrders/index.tsx +86 -20
  144. package/themes/original/src/components/NavBar/index.tsx +7 -6
  145. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  146. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  147. package/themes/original/src/components/Notifications/index.tsx +144 -0
  148. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  149. package/themes/original/src/components/OrderDetails/index.tsx +108 -218
  150. package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
  151. package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
  152. package/themes/original/src/components/OrderProgress/index.tsx +81 -105
  153. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  154. package/themes/original/src/components/OrderSummary/index.tsx +2 -2
  155. package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
  156. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  157. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  158. package/themes/original/src/components/OrdersOption/index.tsx +97 -100
  159. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  160. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  161. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  162. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  163. package/themes/original/src/components/PlaceSpot/index.tsx +22 -8
  164. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  165. package/themes/original/src/components/ProductForm/index.tsx +240 -254
  166. package/themes/original/src/components/ProductForm/styles.tsx +5 -8
  167. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  168. package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
  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 -49
  172. package/themes/original/src/components/ProfessionalProfile/index.tsx +20 -9
  173. package/themes/original/src/components/Promotions/index.tsx +234 -220
  174. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  175. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  176. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  177. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  178. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  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 +337 -265
  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 +134 -89
  187. package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
  188. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  189. package/themes/original/src/components/SingleProductCard/index.tsx +133 -91
  190. package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
  191. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  192. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  193. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  194. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  195. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  196. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  197. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  198. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  199. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  200. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  201. package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
  202. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  203. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  204. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  205. package/themes/original/src/components/Wallets/index.tsx +177 -164
  206. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  207. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  208. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  209. package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
  210. package/themes/original/src/components/shared/OButton.tsx +9 -4
  211. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  212. package/themes/original/src/components/shared/OInput.tsx +10 -1
  213. package/themes/original/src/layouts/Container.tsx +13 -9
  214. package/themes/original/src/types/index.tsx +38 -6
  215. package/themes/original/src/utils/index.tsx +317 -58
  216. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import styled, { css } from 'styled-components/native';
3
- import { Platform } from 'react-native';
2
+ import { useSafeAreaInsets } from 'react-native-safe-area-context'
3
+ import styled, { css, useTheme } from 'styled-components/native';
4
+ import { Platform, View } from 'react-native';
4
5
 
5
6
  const ContainerStyled = styled.ScrollView`
6
7
  flex: 1;
@@ -10,17 +11,20 @@ const ContainerStyled = styled.ScrollView`
10
11
  background-color: ${(props: any) => props.theme.colors.backgroundPage};
11
12
  `;
12
13
 
13
- const SafeAreaStyled = styled.SafeAreaView`
14
- flex: 1;
15
- background-color: ${(props: any) => props.theme.colors.backgroundPage};
16
- `;
17
-
18
14
  export const Container = (props: any) => {
15
+ const theme = useTheme()
16
+ const insets = useSafeAreaInsets()
19
17
  return (
20
- <SafeAreaStyled>
18
+ <View
19
+ style={{
20
+ flex: 1,
21
+ paddingTop: props.pt ?? insets.top,
22
+ backgroundColor: theme.colors.backgroundPage
23
+ }}
24
+ >
21
25
  <ContainerStyled {...props} ref={props?.forwardRef} keyboardShouldPersistTaps='handled' style={{...props.style}}>
22
26
  {props.children}
23
27
  </ContainerStyled>
24
- </SafeAreaStyled>
28
+ </View>
25
29
  )
26
30
  }
@@ -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,
@@ -170,6 +173,9 @@ export interface BusinessesListingParams {
170
173
  handleChangePriceLevel?: any;
171
174
  businessTypeSelected?: any;
172
175
  logosLayout?: boolean;
176
+ isCustomLayout?: boolean;
177
+ citiesState?: any;
178
+ actualSlug?: any;
173
179
  }
174
180
  export interface HighestRatedBusinessesParams {
175
181
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
@@ -215,6 +221,9 @@ export interface BusinessControllerParams {
215
221
  setFavoriteIds?: any;
216
222
  handleUpdateBusinessList?: any;
217
223
  enableIntersection?: boolean;
224
+ isCustomLayout?: boolean;
225
+ getBusinessOffer?: any;
226
+ handleCustomUpdate?: (businessId: number, changes: any) => {};
218
227
  }
219
228
  export interface BusinessProductsListingParams {
220
229
  navigation?: any;
@@ -240,6 +249,9 @@ export interface BusinessProductsListingParams {
240
249
  handleUpdateProducts?: any;
241
250
  professionalSelected?: any;
242
251
  handleChangeProfessionalSelected?: any;
252
+ handleUpdateProfessionals?: any;
253
+ onBusinessClick?: any;
254
+ onNavigationRedirect?: any;
243
255
  }
244
256
  export interface BusinessBasicInformationParams {
245
257
  navigation?: any;
@@ -305,6 +317,7 @@ export interface SingleProductCardParams {
305
317
  enableIntersection?: boolean;
306
318
  navigation?: any;
307
319
  isPreviously?: any;
320
+ isProductId?: any;
308
321
  }
309
322
  export interface BusinessInformationParams {
310
323
  navigation?: any,
@@ -359,6 +372,8 @@ export interface OrdersOptionParams {
359
372
  refreshOrders?: boolean,
360
373
  setRefreshOrders?: (value: boolean) => void,
361
374
  handleUpdateOrderList?: (orderId: number, changes: any) => {},
375
+ handleUpdateProducts?: (productId: number, changes: any) => {},
376
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
362
377
  isBusiness?: boolean,
363
378
  isProducts?: boolean,
364
379
  businessOrderIds?: any,
@@ -366,6 +381,8 @@ export interface OrdersOptionParams {
366
381
  businessesSearchList?: any,
367
382
  hideOrders?: boolean,
368
383
  BusinessControllerSkeletons?: any,
384
+ businessPaginationProps?: any,
385
+ businesses?: any
369
386
  }
370
387
  export interface ActiveOrdersParams {
371
388
  orders?: any,
@@ -387,6 +404,7 @@ export interface PreviousOrdersParams {
387
404
  getOrderStatus?: any,
388
405
  orderID?: number
389
406
  reorderLoading?: boolean,
407
+ loading?: boolean,
390
408
  loadMoreOrders?: () => {},
391
409
  handleReorder?: (orderId: number) => {},
392
410
  onNavigationRedirect?: (route: string, params?: any) => {}
@@ -518,6 +536,7 @@ export interface FloatingButtonParams {
518
536
  }
519
537
  export interface MomentOptionParams {
520
538
  navigation: any;
539
+ isCart?: any;
521
540
  nopadding?: boolean;
522
541
  datesList: Array<any>;
523
542
  hoursList: Array<any>;
@@ -575,6 +594,8 @@ export interface UpsellingProductsParams {
575
594
  products?: any;
576
595
  onNavigationRedirect?: any;
577
596
  onGoBack?: any;
597
+ singleBusiness?: any;
598
+ isFranchiseApp?: any;
578
599
  }
579
600
 
580
601
  export interface GoogleMapsParams {
@@ -635,6 +656,7 @@ export interface BusinessSearchParams {
635
656
  onNavigationRedirect?: any,
636
657
  handleUpdateProducts: any,
637
658
  handleUpdateBusinessList?: any;
659
+ brandId?: number
638
660
  }
639
661
 
640
662
  export interface NoNetworkParams {
@@ -648,14 +670,15 @@ export interface PlaceSpotParams {
648
670
  spotNumberDefault?: any,
649
671
  vehicleDefault?: any,
650
672
  spotNumber?: any,
651
- setSpotNumber?: any,
673
+ setSpotNumber?: any,
652
674
  orderTypes?: any,
653
675
  placesState?: any,
654
- handleChangePlace? : any,
676
+ handleChangePlace?: any,
655
677
  spotState?: any,
656
678
  vehicle?: any,
657
679
  setVehicle?: any,
658
680
  handleChangeSpot?: any
681
+ setPlaceSpotNumber?: any
659
682
  }
660
683
 
661
684
  export interface PromotionParams {
@@ -719,7 +742,9 @@ export interface PreviousBusinessOrderedParams {
719
742
  businessId?: number,
720
743
  onNavigationRedirect?: any,
721
744
  isBusinessesSearchList?: any,
722
- businessLoading?: boolean
745
+ businessLoading?: boolean,
746
+ businesses?: any
747
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
723
748
  }
724
749
 
725
750
  export interface ServiceFormParams {
@@ -732,13 +757,17 @@ export interface ServiceFormParams {
732
757
  maxProductQuantity: any,
733
758
  businessSlug?: string,
734
759
  onClose: any,
735
- professionalList: any
760
+ professionalList: any,
761
+ productObject?: any,
762
+ professionalListState?: any,
763
+ isCartProduct?: any
736
764
  }
737
765
 
738
766
  export interface ProfessionalFilterParams {
739
767
  professionals?: any,
740
768
  professionalSelected?: any,
741
- handleChangeProfessionalSelected: any
769
+ handleChangeProfessionalSelected: any,
770
+ handleUpdateProfessionals?: any
742
771
  }
743
772
 
744
773
  export interface ProfessionalProfileParams {
@@ -754,11 +783,14 @@ export interface OrderItAgainParams {
754
783
  categoryState: any,
755
784
  currentCart: any,
756
785
  handleUpdateProducts: any,
757
- navigation: any
786
+ navigation: any,
787
+ searchValue?: string
758
788
  }
759
789
 
760
790
  export interface PreviousProductsOrderedParams {
761
791
  products?: any,
792
+ isProductId?: boolean
762
793
  onProductClick?: any,
763
794
  isBusinessesSearchList?: boolean
795
+ handleUpdateProducts?: any
764
796
  }
@@ -1,8 +1,12 @@
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
 
@@ -43,69 +47,113 @@ export const getTraduction = (key: string) => {
43
47
  /**
44
48
  * Change local moment variables
45
49
  */
46
- export const setLocalMoment = (moment : any, t : any) => {
50
+ export const setLocalMoment = (moment: any, t: any) => {
47
51
  moment.locale('custom', {
48
52
  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')
53
+ t('MONTH1', 'January'),
54
+ t('MONTH2', 'February'),
55
+ t('MONTH3', 'March'),
56
+ t('MONTH4', 'April'),
57
+ t('MONTH5', 'May'),
58
+ t('MONTH6', 'June'),
59
+ t('MONTH7', 'July'),
60
+ t('MONTH8', 'August'),
61
+ t('MONTH9', 'September'),
62
+ t('MONTH10', 'October'),
63
+ t('MONTH11', 'November'),
64
+ t('MONTH12', 'December')
61
65
  ],
62
66
  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')
67
+ t('MONTHSHORT1', 'Jan'),
68
+ t('MONTHSHORT2', 'Feb'),
69
+ t('MONTHSHORT3', 'Mar'),
70
+ t('MONTHSHORT4', 'Apr'),
71
+ t('MONTHSHORT5', 'May'),
72
+ t('MONTHSHORT6', 'Jun'),
73
+ t('MONTHSHORT7', 'Jul'),
74
+ t('MONTHSHORT8', 'Aug'),
75
+ t('MONTHSHORT9', 'Sep'),
76
+ t('MONTHSHORT10', 'Oct'),
77
+ t('MONTHSHORT11', 'Nov'),
78
+ t('MONTHSHORT12', 'Dec')
75
79
  ],
76
80
  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')
81
+ t('DAY7', 'Sunday'),
82
+ t('DAY1', 'Monday'),
83
+ t('DAY2', 'Tuesday'),
84
+ t('DAY3', 'Wednesday'),
85
+ t('DAY4', 'Thursday'),
86
+ t('DAY5', 'Friday'),
87
+ t('DAY6', 'Saturday')
84
88
  ],
85
89
  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')
90
+ t('DAYSHORT7', 'Sun'),
91
+ t('DAYSHORT1', 'Mon'),
92
+ t('DAYSHORT2', 'Tue'),
93
+ t('DAYSHORT3', 'Wed'),
94
+ t('DAYSHORT4', 'Thu'),
95
+ t('DAYSHORT5', 'Fri'),
96
+ t('DAYSHORT6', 'Sat')
93
97
  ],
94
98
  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')
99
+ t('DAYMIN7', 'Su'),
100
+ t('DAYMIN1', 'Mo'),
101
+ t('DAYMIN2', 'Tu'),
102
+ t('DAYMIN3', 'We'),
103
+ t('DAYMIN4', 'Th'),
104
+ t('DAYMIN5', 'Fr'),
105
+ t('DAYMIN6', 'Sa')
102
106
  ],
103
- meridiem : function (hours : any) {
104
- return hours < 12 ? t('AM', 'AM') : t('PM','PM');
107
+ meridiem: function (hours: any) {
108
+ return hours < 12 ? t('AM', 'AM') : t('PM', 'PM');
105
109
  }
106
110
  })
107
111
  }
108
112
 
113
+ export const monthsEnum: any = {
114
+ Jan: 'MONTHSHORT1',
115
+ Feb: 'MONTHSHORT2',
116
+ Mar: 'MONTHSHORT3',
117
+ Apr: 'MONTHSHORT4',
118
+ May: 'MONTHSHORT5',
119
+ Jun: 'MONTHSHORT6',
120
+ Jul: 'MONTHSHORT7',
121
+ Aug: 'MONTHSHORT8',
122
+ Sep: 'MONTHSHORT9',
123
+ Oct: 'MONTHSHORT10',
124
+ Nov: 'MONTHSHORT11',
125
+ Dec: 'MONTHSHORT12',
126
+ }
127
+
128
+ export const locale = {
129
+ name: languageState?.language?.code?.slice(0, 2),
130
+ config: {
131
+ months: [
132
+ t('MONTH1', 'January'),
133
+ t('MONTH2', 'February'),
134
+ t('MONTH3', 'March'),
135
+ t('MONTH4', 'April'),
136
+ t('MONTH5', 'May'),
137
+ t('MONTH6', 'June'),
138
+ t('MONTH7', 'July'),
139
+ t('MONTH8', 'August'),
140
+ t('MONTH9', 'September'),
141
+ t('MONTH10', 'October'),
142
+ t('MONTH11', 'November'),
143
+ t('MONTH12', 'December')
144
+ ],
145
+ weekdaysShort: [
146
+ t('DAYSHORT7', 'Sun'),
147
+ t('DAYSHORT1', 'Mon'),
148
+ t('DAYSHORT2', 'Tue'),
149
+ t('DAYSHORT3', 'Wed'),
150
+ t('DAYSHORT4', 'Thu'),
151
+ t('DAYSHORT5', 'Fri'),
152
+ t('DAYSHORT6', 'Sat')
153
+ ],
154
+ }
155
+ };
156
+
109
157
  /**
110
158
  * Function to convert delivery time in minutes
111
159
  * @param {string} time business delivery time
@@ -182,7 +230,7 @@ export const getIconCard = (brand: string, size: number) => {
182
230
  * Function to return a static google maps image based in location
183
231
  * @param {object} param object with latitude and logitude
184
232
  */
185
- export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
233
+ export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
186
234
  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
235
  }
188
236
  /**
@@ -213,8 +261,8 @@ export const sortInputFields = ({ fields, values }: any) => {
213
261
  return fieldsSorted;
214
262
  }
215
263
 
216
- export const transformCountryCode = (countryCode : number) => {
217
- const code = CODES.find((code : any) => code.phoneCode === countryCode)
264
+ export const transformCountryCode = (countryCode: number) => {
265
+ const code = CODES.find((code: any) => code.phoneCode === countryCode)
218
266
  return code?.countryCode
219
267
  }
220
268
 
@@ -224,7 +272,7 @@ export const transformCountryCode = (countryCode : number) => {
224
272
  * @param {*} parser function fallback when is decimal
225
273
  * @returns string
226
274
  */
227
- export const verifyDecimals = (value: number, parser: any) => {
275
+ export const verifyDecimals = (value: number, parser: any) => {
228
276
  if (value % 1 === 0) {
229
277
  return value
230
278
  } else {
@@ -240,7 +288,7 @@ export const getTypesText = (value: number) => {
240
288
  /**
241
289
  * List shape for ribbon
242
290
  */
243
- export const shape = {
291
+ export const shape = {
244
292
  rectangle: 'rectangle',
245
293
  rectangleRound: 'rectangle_round',
246
294
  capsuleShape: 'capsule_shape'
@@ -251,7 +299,7 @@ export const getTypesText = (value: number) => {
251
299
  * @param {number} value for transform
252
300
  *
253
301
  */
254
- export const convertToRadian = (value: number) => {
302
+ export const convertToRadian = (value: number) => {
255
303
  return value * Math.PI / 180
256
304
  }
257
305
 
@@ -273,14 +321,14 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
273
321
  return R * c
274
322
  }
275
323
 
276
- export const formatUrlVideo = (url : string) => {
324
+ export const formatUrlVideo = (url: string) => {
277
325
  const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
278
326
  const match = url.match(regExp)
279
327
  const id = (match && match[7].length === 11) ? match[7] : false
280
328
  return `https://www.youtube-nocookie.com/embed/${id}`
281
329
  }
282
330
 
283
- export const formatSeconds = (seconds : number) => {
331
+ export const formatSeconds = (seconds: number) => {
284
332
  // Hours, minutes and seconds
285
333
  var hrs = ~~(seconds / 3600)
286
334
  var mins = ~~((seconds % 3600) / 60)
@@ -299,10 +347,221 @@ export const formatSeconds = (seconds : number) => {
299
347
  /**
300
348
  * List of price to filter businesses
301
349
  */
302
- export const priceList = [
350
+ export const priceList = [
303
351
  { level: '1', content: '$' },
304
352
  { level: '2', content: '$$' },
305
353
  { level: '3', content: '$$$' },
306
354
  { level: '4', content: '$$$$' },
307
355
  { level: '5', content: '$$$$$' }
308
356
  ]
357
+
358
+ export const getLogisticTag = (status: any) => {
359
+ const [, t] = useLanguage()
360
+ const keyList: any = {
361
+ 0: t('PENDING', 'Pending'),
362
+ 1: t('IN_PROGRESS', 'In progress'),
363
+ 2: t('IN_QUEUE', 'In queue'),
364
+ 3: t('EXPIRED', 'Expired'),
365
+ 4: t('RESOLVED', 'Resolved'),
366
+ }
367
+ return keyList[status] ? keyList[status] : t('UNKNOWN', 'Unknown')
368
+ }
369
+
370
+ export const getOrderStatus = (s: string) => {
371
+ const status = parseInt(s);
372
+ const orderStatus = [
373
+ {
374
+ key: 0,
375
+ value: t('PENDING', 'Pending'),
376
+ slug: 'PENDING',
377
+ percentage: 0.25,
378
+ image: theme.images.order.status0,
379
+ },
380
+ {
381
+ key: 1,
382
+ value: t('COMPLETED', 'Completed'),
383
+ slug: 'COMPLETED',
384
+ percentage: 1,
385
+ image: theme.images.order.status1,
386
+ },
387
+ {
388
+ key: 2,
389
+ value: t('REJECTED', 'Rejected'),
390
+ slug: 'REJECTED',
391
+ percentage: 0,
392
+ image: theme.images.order.status2,
393
+ },
394
+ {
395
+ key: 3,
396
+ value: t('DRIVER_IN_BUSINESS', 'Driver in business'),
397
+ slug: 'DRIVER_IN_BUSINESS',
398
+ percentage: 0.6,
399
+ image: theme.images.order.status3,
400
+ },
401
+ {
402
+ key: 4,
403
+ value: t('PREPARATION_COMPLETED', 'Preparation Completed'),
404
+ slug: 'PREPARATION_COMPLETED',
405
+ percentage: 0.7,
406
+ image: theme.images.order.status4,
407
+ },
408
+ {
409
+ key: 5,
410
+ value: t('REJECTED_BY_BUSINESS', 'Rejected by business'),
411
+ slug: 'REJECTED_BY_BUSINESS',
412
+ percentage: 0,
413
+ image: theme.images.order.status5,
414
+ },
415
+ {
416
+ key: 6,
417
+ value: t('REJECTED_BY_DRIVER', 'Rejected by Driver'),
418
+ slug: 'REJECTED_BY_DRIVER',
419
+ percentage: 0,
420
+ image: theme.images.order.status6,
421
+ },
422
+ {
423
+ key: 7,
424
+ value: t('ACCEPTED_BY_BUSINESS', 'Accepted by business'),
425
+ slug: 'ACCEPTED_BY_BUSINESS',
426
+ percentage: 0.35,
427
+ image: theme.images.order.status7,
428
+ },
429
+ {
430
+ key: 8,
431
+ value: t('ACCEPTED_BY_DRIVER', 'Accepted by driver'),
432
+ slug: 'ACCEPTED_BY_DRIVER',
433
+ percentage: 0.45,
434
+ image: theme.images.order.status8,
435
+ },
436
+ {
437
+ key: 9,
438
+ value: t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver'),
439
+ slug: 'PICK_UP_COMPLETED_BY_DRIVER',
440
+ percentage: 0.8,
441
+ image: theme.images.order.status9,
442
+ },
443
+ {
444
+ key: 10,
445
+ value: t('PICK_UP_FAILED_BY_DRIVER', 'Pick up Failed by driver'),
446
+ slug: 'PICK_UP_FAILED_BY_DRIVER',
447
+ percentage: 0,
448
+ image: theme.images.order.status10,
449
+ },
450
+ {
451
+ key: 11,
452
+ value: t(
453
+ 'DELIVERY_COMPLETED_BY_DRIVER',
454
+ 'Delivery completed by driver',
455
+ ),
456
+ slug: 'DELIVERY_COMPLETED_BY_DRIVER',
457
+ percentage: 1,
458
+ image: theme.images.order.status11,
459
+ },
460
+ {
461
+ key: 12,
462
+ value: t('DELIVERY_FAILED_BY_DRIVER', 'Delivery Failed by driver'),
463
+ slug: 'DELIVERY_FAILED_BY_DRIVER',
464
+ percentage: 0,
465
+ image: theme.images.order.status12,
466
+ },
467
+ {
468
+ key: 13,
469
+ value: t('PREORDER', 'PreOrder'),
470
+ slug: 'PREORDER',
471
+ percentage: 0,
472
+ image: theme.images.order.status13,
473
+ },
474
+ {
475
+ key: 14,
476
+ value: t('ORDER_NOT_READY', 'Order not ready'),
477
+ slug: 'ORDER_NOT_READY',
478
+ percentage: 0,
479
+ image: theme.images.order.status13,
480
+ },
481
+ {
482
+ key: 15,
483
+ value: t(
484
+ 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
485
+ 'Order picked up completed by customer',
486
+ ),
487
+ slug: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
488
+ percentage: 100,
489
+ image: theme.images.order.status1,
490
+ },
491
+ {
492
+ key: 16,
493
+ value: t('CANCELLED_BY_CUSTOMER', 'Cancelled by customer'),
494
+ slug: 'CANCELLED_BY_CUSTOMER',
495
+ percentage: 0,
496
+ image: theme.images.order.status2,
497
+ },
498
+ {
499
+ key: 17,
500
+ value: t(
501
+ 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
502
+ 'Order not picked up by customer',
503
+ ),
504
+ slug: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
505
+ percentage: 0,
506
+ image: theme.images.order.status2,
507
+ },
508
+ {
509
+ key: 18,
510
+ value: t(
511
+ 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
512
+ 'Driver almost arrived to business',
513
+ ),
514
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS',
515
+ percentage: 0.15,
516
+ image: theme.images.order.status3,
517
+ },
518
+ {
519
+ key: 19,
520
+ value: t(
521
+ 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
522
+ 'Driver almost arrived to customer',
523
+ ),
524
+ slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER',
525
+ percentage: 0.9,
526
+ image: theme.images.order.status11,
527
+ },
528
+ {
529
+ key: 20,
530
+ value: t(
531
+ 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
532
+ 'Customer almost arrived to business',
533
+ ),
534
+ slug: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
535
+ percentage: 90,
536
+ image: theme.images.order.status7,
537
+ },
538
+ {
539
+ key: 21,
540
+ value: t(
541
+ 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
542
+ 'Customer arrived to business',
543
+ ),
544
+ slug: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
545
+ percentage: 95,
546
+ image: theme.images.order.status7,
547
+ },
548
+ {
549
+ key: 22,
550
+ value: t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver'),
551
+ slug: 'ORDER_LOOKING_FOR_DRIVER',
552
+ percentage: 35,
553
+ image: theme.images.order.status8
554
+ },
555
+ {
556
+ key: 23,
557
+ value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
558
+ slug: 'ORDER_DRIVER_ON_WAY',
559
+ percentage: 45,
560
+ image: theme.images.order.status8
561
+ }
562
+ ];
563
+
564
+ const objectStatus = orderStatus.find((o) => o.key === status);
565
+
566
+ return objectStatus && objectStatus;
567
+ }
@@ -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}>