ordering-ui-react-native 0.16.59 → 0.16.60-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 (202) hide show
  1. package/package.json +6 -5
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/ActiveOrders/index.tsx +61 -63
  4. package/src/components/ActiveOrders/styles.tsx +8 -14
  5. package/src/components/BusinessInformation/index.tsx +19 -4
  6. package/src/components/BusinessInformation/styles.tsx +2 -2
  7. package/src/components/BusinessProductsList/index.tsx +10 -10
  8. package/src/components/BusinessesListing/index.tsx +1 -1
  9. package/src/components/Checkout/index.tsx +2 -1
  10. package/src/components/LanguageSelector/index.tsx +21 -16
  11. package/src/components/Messages/index.tsx +2 -2
  12. package/src/components/NotificationSetting/index.tsx +85 -0
  13. package/src/components/OrdersOption/index.tsx +54 -56
  14. package/src/components/PaymentOptions/index.tsx +298 -345
  15. package/src/components/PaymentOptionsWebView/index.tsx +119 -120
  16. package/src/components/SingleProductReview/index.tsx +7 -4
  17. package/src/components/StripeElementsForm/index.tsx +25 -16
  18. package/src/components/VerifyPhone/styles.tsx +1 -2
  19. package/src/components/shared/OBottomPopup.tsx +6 -2
  20. package/src/components/shared/OToast.tsx +4 -4
  21. package/src/index.tsx +2 -0
  22. package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
  23. package/src/utils/index.tsx +2 -1
  24. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
  25. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  26. package/themes/business/src/components/BusinessController/index.tsx +2 -2
  27. package/themes/business/src/components/Chat/index.tsx +40 -32
  28. package/themes/business/src/components/DriverMap/index.tsx +7 -5
  29. package/themes/business/src/components/LoginForm/index.tsx +111 -74
  30. package/themes/business/src/components/MapView/index.tsx +12 -1
  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/OrdersListManager/index.tsx +10 -3
  36. package/themes/business/src/components/OrdersOption/index.tsx +76 -77
  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 +440 -245
  49. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  50. package/themes/business/src/components/ProductItemAccordion/index.tsx +3 -2
  51. package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
  52. package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
  53. package/themes/business/src/components/UserProfileForm/index.tsx +2 -0
  54. package/themes/business/src/components/shared/ODropDown.tsx +42 -8
  55. package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
  56. package/themes/business/src/components/shared/OLink.tsx +33 -13
  57. package/themes/business/src/components/shared/OText.tsx +8 -2
  58. package/themes/business/src/types/index.tsx +25 -11
  59. package/themes/business/src/utils/index.tsx +10 -0
  60. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  61. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  62. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  63. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  64. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  65. package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
  66. package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -0
  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/ProductForm/index.tsx +1 -14
  71. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  72. package/themes/kiosk/src/types/index.d.ts +2 -0
  73. package/themes/original/index.tsx +8 -0
  74. package/themes/original/src/components/AddressDetails/index.tsx +10 -8
  75. package/themes/original/src/components/AddressForm/index.tsx +153 -137
  76. package/themes/original/src/components/AddressList/index.tsx +1 -1
  77. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  78. package/themes/original/src/components/BusinessBasicInformation/index.tsx +53 -37
  79. package/themes/original/src/components/BusinessController/index.tsx +112 -48
  80. package/themes/original/src/components/BusinessController/styles.tsx +14 -9
  81. package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
  82. package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
  83. package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
  84. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
  85. package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
  86. package/themes/original/src/components/BusinessListingSearch/index.tsx +87 -142
  87. package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
  88. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
  89. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
  90. package/themes/original/src/components/BusinessProductsList/index.tsx +59 -61
  91. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  92. package/themes/original/src/components/BusinessProductsListing/index.tsx +177 -93
  93. package/themes/original/src/components/BusinessProductsListing/styles.tsx +14 -12
  94. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  95. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  96. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +112 -107
  97. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  98. package/themes/original/src/components/BusinessesListing/index.tsx +16 -9
  99. package/themes/original/src/components/Cart/index.tsx +77 -24
  100. package/themes/original/src/components/Cart/styles.tsx +4 -0
  101. package/themes/original/src/components/CartContent/index.tsx +77 -18
  102. package/themes/original/src/components/CartContent/styles.tsx +11 -1
  103. package/themes/original/src/components/Checkout/index.tsx +115 -118
  104. package/themes/original/src/components/Checkout/styles.tsx +4 -3
  105. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  106. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  107. package/themes/original/src/components/DriverTips/index.tsx +4 -4
  108. package/themes/original/src/components/DriverTips/styles.tsx +2 -1
  109. package/themes/original/src/components/FavoriteList/index.tsx +69 -45
  110. package/themes/original/src/components/FloatingButton/index.tsx +0 -1
  111. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  112. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  113. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  114. package/themes/original/src/components/GoogleMap/index.tsx +10 -1
  115. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +25 -10
  116. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +4 -0
  117. package/themes/original/src/components/HelpGuide/index.tsx +9 -8
  118. package/themes/original/src/components/HelpOrder/index.tsx +9 -8
  119. package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
  120. package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
  121. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  122. package/themes/original/src/components/LoginForm/index.tsx +98 -41
  123. package/themes/original/src/components/LottieAnimation/index.tsx +69 -0
  124. package/themes/original/src/components/Messages/index.tsx +35 -20
  125. package/themes/original/src/components/MomentOption/index.tsx +8 -6
  126. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  127. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
  128. package/themes/original/src/components/MultiCheckout/index.tsx +96 -65
  129. package/themes/original/src/components/MultiOrdersDetails/index.tsx +34 -16
  130. package/themes/original/src/components/MyOrders/index.tsx +89 -25
  131. package/themes/original/src/components/NavBar/index.tsx +11 -5
  132. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  133. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  134. package/themes/original/src/components/Notifications/index.tsx +148 -0
  135. package/themes/original/src/components/Notifications/styles.tsx +20 -0
  136. package/themes/original/src/components/OrderDetails/index.tsx +114 -15
  137. package/themes/original/src/components/OrderDetails/styles.tsx +15 -2
  138. package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
  139. package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
  140. package/themes/original/src/components/OrderProgress/index.tsx +77 -66
  141. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  142. package/themes/original/src/components/OrderSummary/index.tsx +2 -35
  143. package/themes/original/src/components/OrderTypeSelector/index.tsx +85 -36
  144. package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
  145. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +94 -98
  146. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
  147. package/themes/original/src/components/OrdersOption/index.tsx +95 -55
  148. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  149. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  150. package/themes/original/src/components/PaymentOptions/index.tsx +1 -2
  151. package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
  152. package/themes/original/src/components/PlaceSpot/index.tsx +249 -47
  153. package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
  154. package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
  155. package/themes/original/src/components/ProductForm/index.tsx +379 -396
  156. package/themes/original/src/components/ProductForm/styles.tsx +7 -12
  157. package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
  158. package/themes/original/src/components/ProductOption/index.tsx +1 -1
  159. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  160. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  161. package/themes/original/src/components/ProfessionalFilter/index.tsx +2 -1
  162. package/themes/original/src/components/ProfessionalProfile/index.tsx +19 -8
  163. package/themes/original/src/components/Promotions/index.tsx +232 -219
  164. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  165. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  166. package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
  167. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  168. package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
  169. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  170. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  171. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  172. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  173. package/themes/original/src/components/ServiceForm/index.tsx +328 -264
  174. package/themes/original/src/components/SignupForm/index.tsx +134 -89
  175. package/themes/original/src/components/SingleOrderCard/index.tsx +240 -130
  176. package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
  177. package/themes/original/src/components/SingleProductCard/index.tsx +116 -72
  178. package/themes/original/src/components/SingleProductCard/styles.tsx +2 -9
  179. package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
  180. package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
  181. package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
  182. package/themes/original/src/components/StripeElementsForm/index.tsx +13 -2
  183. package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
  184. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  185. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  186. package/themes/original/src/components/UserFormDetails/index.tsx +6 -48
  187. package/themes/original/src/components/UserProfile/index.tsx +58 -35
  188. package/themes/original/src/components/UserProfile/styles.ts +17 -0
  189. package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
  190. package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
  191. package/themes/original/src/components/Wallets/index.tsx +176 -164
  192. package/themes/original/src/components/Wallets/styles.tsx +12 -8
  193. package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
  194. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  195. package/themes/original/src/components/shared/OBottomPopup.tsx +11 -7
  196. package/themes/original/src/components/shared/OButton.tsx +8 -3
  197. package/themes/original/src/components/shared/OIcon.tsx +8 -1
  198. package/themes/original/src/components/shared/OInput.tsx +10 -1
  199. package/themes/original/src/layouts/Container.tsx +13 -9
  200. package/themes/original/src/types/index.tsx +65 -8
  201. package/themes/original/src/utils/index.tsx +103 -58
  202. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -3,6 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
3
3
  import styled from 'styled-components/native';
4
4
  import OIcon from './OIcon';
5
5
  import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
6
+ import { useTheme } from 'styled-components/native';
6
7
 
7
8
  const Input = styled.TextInput`
8
9
  flex-grow: 1;
@@ -39,6 +40,7 @@ interface Props extends TextInputProps {
39
40
  inputStyle?: TextStyle;
40
41
  wrapperRef?: any;
41
42
  onPress?: any;
43
+ isFocusHighlight?: boolean
42
44
  }
43
45
 
44
46
  const Wrapper = styled.Pressable`
@@ -54,12 +56,16 @@ const Wrapper = styled.Pressable`
54
56
  `;
55
57
 
56
58
  const OInput = (props: Props): React.ReactElement => {
59
+ const theme = useTheme();
60
+ const [inputFocused, setInputFocused] = React.useState(false)
57
61
  return (
58
62
  <Wrapper
59
63
  onPress={() => { props.forwardRef?.current?.focus?.(); props.onPress && props.onPress() }}
60
64
  style={{
61
65
  backgroundColor: props.bgColor,
62
- borderColor: props.borderColor,
66
+ borderColor: !props.isFocusHighlight
67
+ ? props.borderColor
68
+ : inputFocused ? theme.colors.primary : theme.colors.border,
63
69
  ...props.style,
64
70
  }}>
65
71
  {props.icon ? (
@@ -95,6 +101,8 @@ const OInput = (props: Props): React.ReactElement => {
95
101
  props.forwardRef && (props.forwardRef.current = e)
96
102
  }}
97
103
  style={props?.inputStyle}
104
+ onFocus={() => setInputFocused(true)}
105
+ onBlur={() => setInputFocused(false)}
98
106
  />
99
107
  {props.iconRight && (
100
108
  <OIcon
@@ -114,6 +122,7 @@ OInput.defaultProps = {
114
122
  iconColor: '#959595',
115
123
  bgColor: 'white',
116
124
  borderColor: 'white',
125
+ isFocusHighlight: false
117
126
  };
118
127
 
119
128
  export default OInput;
@@ -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,
@@ -169,6 +172,10 @@ export interface BusinessesListingParams {
169
172
  priceLevelSelected?: any;
170
173
  handleChangePriceLevel?: any;
171
174
  businessTypeSelected?: any;
175
+ logosLayout?: boolean;
176
+ isCustomLayout?: boolean;
177
+ citiesState?: any;
178
+ actualSlug?: any;
172
179
  }
173
180
  export interface HighestRatedBusinessesParams {
174
181
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
@@ -214,6 +221,9 @@ export interface BusinessControllerParams {
214
221
  setFavoriteIds?: any;
215
222
  handleUpdateBusinessList?: any;
216
223
  enableIntersection?: boolean;
224
+ isCustomLayout?: boolean;
225
+ getBusinessOffer?: any;
226
+ handleCustomUpdate?: (businessId: number, changes: any) => {};
217
227
  }
218
228
  export interface BusinessProductsListingParams {
219
229
  navigation?: any;
@@ -239,6 +249,9 @@ export interface BusinessProductsListingParams {
239
249
  handleUpdateProducts?: any;
240
250
  professionalSelected?: any;
241
251
  handleChangeProfessionalSelected?: any;
252
+ handleUpdateProfessionals?: any;
253
+ onBusinessClick?: any;
254
+ onNavigationRedirect?: any;
242
255
  }
243
256
  export interface BusinessBasicInformationParams {
244
257
  navigation?: any;
@@ -287,7 +300,9 @@ export interface BusinessProductsListParams {
287
300
  onClickCategory?: any,
288
301
  lazyLoadProductsRecommended?: boolean,
289
302
  isFiltMode?: boolean,
290
- handleUpdateProducts?: any
303
+ handleUpdateProducts?: any,
304
+ navigation?: any;
305
+ previouslyProducts?: any;
291
306
  }
292
307
  export interface SingleProductCardParams {
293
308
  businessId: any;
@@ -300,6 +315,9 @@ export interface SingleProductCardParams {
300
315
  handleFavoriteProduct?: any;
301
316
  handleUpdateProducts?: any;
302
317
  enableIntersection?: boolean;
318
+ navigation?: any;
319
+ isPreviously?: any;
320
+ isProductId?: any;
303
321
  }
304
322
  export interface BusinessInformationParams {
305
323
  navigation?: any,
@@ -354,6 +372,8 @@ export interface OrdersOptionParams {
354
372
  refreshOrders?: boolean,
355
373
  setRefreshOrders?: (value: boolean) => void,
356
374
  handleUpdateOrderList?: (orderId: number, changes: any) => {},
375
+ handleUpdateProducts?: (productId: number, changes: any) => {},
376
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
357
377
  isBusiness?: boolean,
358
378
  isProducts?: boolean,
359
379
  businessOrderIds?: any,
@@ -361,6 +381,8 @@ export interface OrdersOptionParams {
361
381
  businessesSearchList?: any,
362
382
  hideOrders?: boolean,
363
383
  BusinessControllerSkeletons?: any,
384
+ businessPaginationProps?: any,
385
+ businesses?: any
364
386
  }
365
387
  export interface ActiveOrdersParams {
366
388
  orders?: any,
@@ -382,6 +404,7 @@ export interface PreviousOrdersParams {
382
404
  getOrderStatus?: any,
383
405
  orderID?: number
384
406
  reorderLoading?: boolean,
407
+ loading?: boolean,
385
408
  loadMoreOrders?: () => {},
386
409
  handleReorder?: (orderId: number) => {},
387
410
  onNavigationRedirect?: (route: string, params?: any) => {}
@@ -549,7 +572,9 @@ export interface OrderTypeSelectParams {
549
572
  defaultValue?: number;
550
573
  configTypes?: Array<any>;
551
574
  orderTypes: Array<any>;
552
- setOrderTypeValue?: (value: number) => any
575
+ setOrderTypeValue?: (value: number) => any,
576
+ isChewLayout?: boolean;
577
+ chewOrderTypes?: any;
553
578
  }
554
579
  export interface UpsellingProductsParams {
555
580
  isCustomMode?: boolean;
@@ -568,6 +593,8 @@ export interface UpsellingProductsParams {
568
593
  products?: any;
569
594
  onNavigationRedirect?: any;
570
595
  onGoBack?: any;
596
+ singleBusiness?: any;
597
+ isFranchiseApp?: any;
571
598
  }
572
599
 
573
600
  export interface GoogleMapsParams {
@@ -628,6 +655,7 @@ export interface BusinessSearchParams {
628
655
  onNavigationRedirect?: any,
629
656
  handleUpdateProducts: any,
630
657
  handleUpdateBusinessList?: any;
658
+ brandId?: number
631
659
  }
632
660
 
633
661
  export interface NoNetworkParams {
@@ -635,12 +663,21 @@ export interface NoNetworkParams {
635
663
  }
636
664
 
637
665
  export interface PlaceSpotParams {
638
- isOpenPlaceSpot?: boolean,
666
+ isCheckout?: any,
667
+ isInputMode?: any,
639
668
  cart?: any,
669
+ spotNumberDefault?: any,
670
+ vehicleDefault?: any,
671
+ spotNumber?: any,
672
+ setSpotNumber?: any,
673
+ orderTypes?: any,
640
674
  placesState?: any,
641
675
  handleChangePlace?: any,
642
- getPlacesList?: any,
643
- setOpenPlaceModal?: any
676
+ spotState?: any,
677
+ vehicle?: any,
678
+ setVehicle?: any,
679
+ handleChangeSpot?: any
680
+ setPlaceSpotNumber?: any
644
681
  }
645
682
 
646
683
  export interface PromotionParams {
@@ -692,7 +729,9 @@ export interface SingleOrderCardParams {
692
729
  onNavigationRedirect?: (route: string, params?: any) => {},
693
730
  pastOrders: any,
694
731
  isMessageView?: any,
695
- handleClickOrder: (value: any) => {}
732
+ handleClickOrder: (value: any) => {},
733
+ handleRemoveCart: () => {},
734
+ cartState: any
696
735
  }
697
736
 
698
737
  export interface PreviousBusinessOrderedParams {
@@ -702,7 +741,9 @@ export interface PreviousBusinessOrderedParams {
702
741
  businessId?: number,
703
742
  onNavigationRedirect?: any,
704
743
  isBusinessesSearchList?: any,
705
- businessLoading?: boolean
744
+ businessLoading?: boolean,
745
+ businesses?: any
746
+ handleUpdateBusinesses?: (businessId: number, changes: any) => {},
706
747
  }
707
748
 
708
749
  export interface ServiceFormParams {
@@ -715,7 +756,10 @@ export interface ServiceFormParams {
715
756
  maxProductQuantity: any,
716
757
  businessSlug?: string,
717
758
  onClose: any,
718
- professionalList: any
759
+ professionalList: any,
760
+ productObject?: any,
761
+ professionalListState?: any,
762
+ isCartProduct?: any
719
763
  }
720
764
 
721
765
  export interface ProfessionalFilterParams {
@@ -730,8 +774,21 @@ export interface ProfessionalProfileParams {
730
774
  onClose: any
731
775
  }
732
776
 
777
+ export interface OrderItAgainParams {
778
+ onProductClick: any,
779
+ productList: any,
780
+ businessId: any,
781
+ categoryState: any,
782
+ currentCart: any,
783
+ handleUpdateProducts: any,
784
+ navigation: any,
785
+ searchValue?: string
786
+ }
787
+
733
788
  export interface PreviousProductsOrderedParams {
734
789
  products?: any,
790
+ isProductId?: boolean
735
791
  onProductClick?: any,
736
792
  isBusinessesSearchList?: boolean
793
+ handleUpdateProducts?: any
737
794
  }
@@ -1,10 +1,11 @@
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
6
 
7
7
  export const flatArray = (arr: any) => [].concat(...arr)
8
+ const [languageState, t] = useLanguage();
8
9
 
9
10
  /**
10
11
  * Function to return the traduction depending of a key 't'
@@ -43,69 +44,113 @@ export const getTraduction = (key: string) => {
43
44
  /**
44
45
  * Change local moment variables
45
46
  */
46
- export const setLocalMoment = (moment : any, t : any) => {
47
+ export const setLocalMoment = (moment: any, t: any) => {
47
48
  moment.locale('custom', {
48
49
  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')
50
+ t('MONTH1', 'January'),
51
+ t('MONTH2', 'February'),
52
+ t('MONTH3', 'March'),
53
+ t('MONTH4', 'April'),
54
+ t('MONTH5', 'May'),
55
+ t('MONTH6', 'June'),
56
+ t('MONTH7', 'July'),
57
+ t('MONTH8', 'August'),
58
+ t('MONTH9', 'September'),
59
+ t('MONTH10', 'October'),
60
+ t('MONTH11', 'November'),
61
+ t('MONTH12', 'December')
61
62
  ],
62
63
  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')
64
+ t('MONTHSHORT1', 'Jan'),
65
+ t('MONTHSHORT2', 'Feb'),
66
+ t('MONTHSHORT3', 'Mar'),
67
+ t('MONTHSHORT4', 'Apr'),
68
+ t('MONTHSHORT5', 'May'),
69
+ t('MONTHSHORT6', 'Jun'),
70
+ t('MONTHSHORT7', 'Jul'),
71
+ t('MONTHSHORT8', 'Aug'),
72
+ t('MONTHSHORT9', 'Sep'),
73
+ t('MONTHSHORT10', 'Oct'),
74
+ t('MONTHSHORT11', 'Nov'),
75
+ t('MONTHSHORT12', 'Dec')
75
76
  ],
76
77
  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')
78
+ t('DAY7', 'Sunday'),
79
+ t('DAY1', 'Monday'),
80
+ t('DAY2', 'Tuesday'),
81
+ t('DAY3', 'Wednesday'),
82
+ t('DAY4', 'Thursday'),
83
+ t('DAY5', 'Friday'),
84
+ t('DAY6', 'Saturday')
84
85
  ],
85
86
  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')
87
+ t('DAYSHORT7', 'Sun'),
88
+ t('DAYSHORT1', 'Mon'),
89
+ t('DAYSHORT2', 'Tue'),
90
+ t('DAYSHORT3', 'Wed'),
91
+ t('DAYSHORT4', 'Thu'),
92
+ t('DAYSHORT5', 'Fri'),
93
+ t('DAYSHORT6', 'Sat')
93
94
  ],
94
95
  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')
96
+ t('DAYMIN7', 'Su'),
97
+ t('DAYMIN1', 'Mo'),
98
+ t('DAYMIN2', 'Tu'),
99
+ t('DAYMIN3', 'We'),
100
+ t('DAYMIN4', 'Th'),
101
+ t('DAYMIN5', 'Fr'),
102
+ t('DAYMIN6', 'Sa')
102
103
  ],
103
- meridiem : function (hours : any) {
104
- return hours < 12 ? t('AM', 'AM') : t('PM','PM');
104
+ meridiem: function (hours: any) {
105
+ return hours < 12 ? t('AM', 'AM') : t('PM', 'PM');
105
106
  }
106
107
  })
107
108
  }
108
109
 
110
+ export const monthsEnum: any = {
111
+ Jan: 'MONTHSHORT1',
112
+ Feb: 'MONTHSHORT2',
113
+ Mar: 'MONTHSHORT3',
114
+ Apr: 'MONTHSHORT4',
115
+ May: 'MONTHSHORT5',
116
+ Jun: 'MONTHSHORT6',
117
+ Jul: 'MONTHSHORT7',
118
+ Aug: 'MONTHSHORT8',
119
+ Sep: 'MONTHSHORT9',
120
+ Oct: 'MONTHSHORT10',
121
+ Nov: 'MONTHSHORT11',
122
+ Dec: 'MONTHSHORT12',
123
+ }
124
+
125
+ export const locale = {
126
+ name: languageState?.language?.code?.slice(0, 2),
127
+ config: {
128
+ months: [
129
+ t('MONTH1', 'January'),
130
+ t('MONTH2', 'February'),
131
+ t('MONTH3', 'March'),
132
+ t('MONTH4', 'April'),
133
+ t('MONTH5', 'May'),
134
+ t('MONTH6', 'June'),
135
+ t('MONTH7', 'July'),
136
+ t('MONTH8', 'August'),
137
+ t('MONTH9', 'September'),
138
+ t('MONTH10', 'October'),
139
+ t('MONTH11', 'November'),
140
+ t('MONTH12', 'December')
141
+ ],
142
+ weekdaysShort: [
143
+ t('DAYSHORT7', 'Sun'),
144
+ t('DAYSHORT1', 'Mon'),
145
+ t('DAYSHORT2', 'Tue'),
146
+ t('DAYSHORT3', 'Wed'),
147
+ t('DAYSHORT4', 'Thu'),
148
+ t('DAYSHORT5', 'Fri'),
149
+ t('DAYSHORT6', 'Sat')
150
+ ],
151
+ }
152
+ };
153
+
109
154
  /**
110
155
  * Function to convert delivery time in minutes
111
156
  * @param {string} time business delivery time
@@ -182,7 +227,7 @@ export const getIconCard = (brand: string, size: number) => {
182
227
  * Function to return a static google maps image based in location
183
228
  * @param {object} param object with latitude and logitude
184
229
  */
185
- export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
230
+ export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
186
231
  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
232
  }
188
233
  /**
@@ -213,8 +258,8 @@ export const sortInputFields = ({ fields, values }: any) => {
213
258
  return fieldsSorted;
214
259
  }
215
260
 
216
- export const transformCountryCode = (countryCode : number) => {
217
- const code = CODES.find((code : any) => code.phoneCode === countryCode)
261
+ export const transformCountryCode = (countryCode: number) => {
262
+ const code = CODES.find((code: any) => code.phoneCode === countryCode)
218
263
  return code?.countryCode
219
264
  }
220
265
 
@@ -224,7 +269,7 @@ export const transformCountryCode = (countryCode : number) => {
224
269
  * @param {*} parser function fallback when is decimal
225
270
  * @returns string
226
271
  */
227
- export const verifyDecimals = (value: number, parser: any) => {
272
+ export const verifyDecimals = (value: number, parser: any) => {
228
273
  if (value % 1 === 0) {
229
274
  return value
230
275
  } else {
@@ -240,7 +285,7 @@ export const getTypesText = (value: number) => {
240
285
  /**
241
286
  * List shape for ribbon
242
287
  */
243
- export const shape = {
288
+ export const shape = {
244
289
  rectangle: 'rectangle',
245
290
  rectangleRound: 'rectangle_round',
246
291
  capsuleShape: 'capsule_shape'
@@ -251,7 +296,7 @@ export const getTypesText = (value: number) => {
251
296
  * @param {number} value for transform
252
297
  *
253
298
  */
254
- export const convertToRadian = (value: number) => {
299
+ export const convertToRadian = (value: number) => {
255
300
  return value * Math.PI / 180
256
301
  }
257
302
 
@@ -273,14 +318,14 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
273
318
  return R * c
274
319
  }
275
320
 
276
- export const formatUrlVideo = (url : string) => {
321
+ export const formatUrlVideo = (url: string) => {
277
322
  const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
278
323
  const match = url.match(regExp)
279
324
  const id = (match && match[7].length === 11) ? match[7] : false
280
325
  return `https://www.youtube-nocookie.com/embed/${id}`
281
326
  }
282
327
 
283
- export const formatSeconds = (seconds : number) => {
328
+ export const formatSeconds = (seconds: number) => {
284
329
  // Hours, minutes and seconds
285
330
  var hrs = ~~(seconds / 3600)
286
331
  var mins = ~~((seconds % 3600) / 60)
@@ -299,7 +344,7 @@ export const formatSeconds = (seconds : number) => {
299
344
  /**
300
345
  * List of price to filter businesses
301
346
  */
302
- export const priceList = [
347
+ export const priceList = [
303
348
  { level: '1', content: '$' },
304
349
  { level: '2', content: '$$' },
305
350
  { level: '3', content: '$$$' },
@@ -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}>