ordering-ui-react-native 0.21.78 → 0.21.79-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 (165) hide show
  1. package/package.json +6 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/PaymentOptionsWebView/index.tsx +1 -0
  5. package/src/components/StripeMethodForm/index.tsx +6 -4
  6. package/src/components/VerifyPhone/styles.tsx +1 -2
  7. package/src/types/index.tsx +3 -1
  8. package/themes/business/index.tsx +4 -0
  9. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -6
  10. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +1 -0
  11. package/themes/business/src/components/BusinessProductList/index.tsx +2 -1
  12. package/themes/business/src/components/Chat/index.tsx +3 -1
  13. package/themes/business/src/components/DriverMap/index.tsx +44 -27
  14. package/themes/business/src/components/GoogleMap/index.tsx +15 -8
  15. package/themes/business/src/components/Home/index.tsx +5 -1
  16. package/themes/business/src/components/LanguageSelector/index.tsx +2 -3
  17. package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
  18. package/themes/business/src/components/LogoutButton/index.tsx +1 -1
  19. package/themes/business/src/components/MapView/index.tsx +36 -17
  20. package/themes/business/src/components/NewOrderNotification/index.tsx +74 -24
  21. package/themes/business/src/components/OrderDetails/Business.tsx +65 -7
  22. package/themes/business/src/components/OrderDetails/Delivery.tsx +35 -20
  23. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +110 -40
  24. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +61 -35
  25. package/themes/business/src/components/OrderDetails/styles.tsx +39 -3
  26. package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
  27. package/themes/business/src/components/OrderSummary/index.tsx +222 -72
  28. package/themes/business/src/components/OrdersListManager/index.tsx +9 -1
  29. package/themes/business/src/components/OrdersOption/index.tsx +247 -159
  30. package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
  31. package/themes/business/src/components/PreviousMessages/index.tsx +12 -0
  32. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +25 -15
  33. package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
  34. package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
  35. package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
  36. package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
  37. package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
  40. package/themes/business/src/components/Sessions/index.tsx +187 -0
  41. package/themes/business/src/components/Sessions/styles.tsx +20 -0
  42. package/themes/business/src/components/StoresList/index.tsx +2 -2
  43. package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
  44. package/themes/business/src/components/UserProfileForm/index.tsx +84 -47
  45. package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
  46. package/themes/business/src/components/shared/OInput.tsx +2 -0
  47. package/themes/business/src/components/shared/OTextarea.tsx +8 -9
  48. package/themes/business/src/hooks/useLocation.tsx +5 -4
  49. package/themes/business/src/types/index.tsx +23 -5
  50. package/themes/business/src/utils/index.tsx +19 -1
  51. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  52. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  53. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  54. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  55. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  56. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  57. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  58. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  59. package/themes/original/index.tsx +13 -1
  60. package/themes/original/src/components/AddressDetails/index.tsx +20 -10
  61. package/themes/original/src/components/AddressForm/index.tsx +32 -17
  62. package/themes/original/src/components/AddressList/index.tsx +8 -7
  63. package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
  64. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  65. package/themes/original/src/components/BusinessBasicInformation/index.tsx +6 -9
  66. package/themes/original/src/components/BusinessController/index.tsx +12 -7
  67. package/themes/original/src/components/BusinessItemAccordion/index.tsx +13 -5
  68. package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +2 -3
  69. package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +1 -3
  70. package/themes/original/src/components/BusinessListingSearch/index.tsx +1 -2
  71. package/themes/original/src/components/BusinessPreorder/index.tsx +20 -15
  72. package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
  73. package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
  74. package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
  75. package/themes/original/src/components/BusinessProductsListing/index.tsx +18 -6
  76. package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
  77. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
  78. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
  79. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -1
  80. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  81. package/themes/original/src/components/Cart/index.tsx +38 -11
  82. package/themes/original/src/components/CartContent/index.tsx +21 -8
  83. package/themes/original/src/components/Checkout/index.tsx +108 -60
  84. package/themes/original/src/components/CitiesControl/index.tsx +0 -3
  85. package/themes/original/src/components/CouponControl/index.tsx +1 -3
  86. package/themes/original/src/components/DriverTips/index.tsx +1 -3
  87. package/themes/original/src/components/Favorite/index.tsx +1 -5
  88. package/themes/original/src/components/FavoriteList/index.tsx +0 -1
  89. package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
  90. package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
  91. package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
  92. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
  93. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
  94. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
  95. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +7 -9
  96. package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
  97. package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
  98. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
  99. package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
  100. package/themes/original/src/components/GoogleMap/index.tsx +39 -18
  101. package/themes/original/src/components/Help/index.tsx +2 -0
  102. package/themes/original/src/components/HighestRatedBusinesses/index.tsx +1 -1
  103. package/themes/original/src/components/Home/index.tsx +2 -10
  104. package/themes/original/src/components/LoginForm/Otp/index.tsx +0 -3
  105. package/themes/original/src/components/LoginForm/index.tsx +4 -7
  106. package/themes/original/src/components/MessageListing/index.tsx +1 -0
  107. package/themes/original/src/components/Messages/index.tsx +8 -7
  108. package/themes/original/src/components/MomentOption/index.tsx +13 -2
  109. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
  110. package/themes/original/src/components/MultiCheckout/index.tsx +139 -87
  111. package/themes/original/src/components/MultiOrdersDetails/index.tsx +2 -1
  112. package/themes/original/src/components/MyOrders/index.tsx +21 -26
  113. package/themes/original/src/components/NavBar/index.tsx +4 -2
  114. package/themes/original/src/components/NetworkError/index.tsx +0 -5
  115. package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
  116. package/themes/original/src/components/OrderDetails/OrderEta.tsx +1 -1
  117. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
  118. package/themes/original/src/components/OrderDetails/index.tsx +27 -10
  119. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  120. package/themes/original/src/components/OrderProgress/index.tsx +22 -3
  121. package/themes/original/src/components/OrderSummary/index.tsx +28 -9
  122. package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
  123. package/themes/original/src/components/OrdersOption/index.tsx +2 -4
  124. package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
  125. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  126. package/themes/original/src/components/PaymentOptions/index.tsx +17 -9
  127. package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
  128. package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
  129. package/themes/original/src/components/ProductForm/ActionButton.tsx +17 -20
  130. package/themes/original/src/components/ProductForm/index.tsx +107 -102
  131. package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
  132. package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
  133. package/themes/original/src/components/ProductOptionSubOption/index.tsx +8 -1
  134. package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
  135. package/themes/original/src/components/Promotions/index.tsx +6 -9
  136. package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
  137. package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
  138. package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
  139. package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
  140. package/themes/original/src/components/ServiceForm/index.tsx +52 -54
  141. package/themes/original/src/components/Sessions/index.tsx +3 -3
  142. package/themes/original/src/components/SignupForm/index.tsx +86 -78
  143. package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
  144. package/themes/original/src/components/SingleProductCard/index.tsx +3 -4
  145. package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
  146. package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
  147. package/themes/original/src/components/StripeCardsList/index.tsx +10 -3
  148. package/themes/original/src/components/StripeElementsForm/index.tsx +77 -60
  149. package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
  150. package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
  151. package/themes/original/src/components/TaxInformation/index.tsx +3 -2
  152. package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
  153. package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
  154. package/themes/original/src/components/UserDetails/index.tsx +3 -2
  155. package/themes/original/src/components/UserFormDetails/index.tsx +155 -131
  156. package/themes/original/src/components/UserProfile/index.tsx +11 -2
  157. package/themes/original/src/components/Wallets/index.tsx +6 -3
  158. package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
  159. package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
  160. package/themes/original/src/components/shared/OAlert.tsx +2 -1
  161. package/themes/original/src/components/shared/OButton.tsx +5 -4
  162. package/themes/original/src/components/shared/OInput.tsx +4 -8
  163. package/themes/original/src/types/index.tsx +5 -1
  164. package/themes/original/src/utils/index.tsx +12 -1
  165. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -217,7 +217,8 @@ const AddressListUI = (props: AddressListParams) => {
217
217
  onSaveAddress: handleSaveAddress,
218
218
  isSelectedAfterAdd: true,
219
219
  isFromProductsList: isFromProductsList,
220
- hasAddressDefault: !!orderState.options?.address?.location
220
+ hasAddressDefault: !!orderState.options?.address?.location,
221
+ isFromCheckout: route?.params?.isFromCheckout
221
222
  }
222
223
  ) : onNavigationRedirect(
223
224
  'AddressFormInitial',
@@ -228,7 +229,8 @@ const AddressListUI = (props: AddressListParams) => {
228
229
  onSaveAddress: handleSaveAddress,
229
230
  isSelectedAfterAdd: true,
230
231
  isFromProductsList: isFromProductsList,
231
- hasAddressDefault: !!orderState.options?.address?.location
232
+ hasAddressDefault: !!orderState.options?.address?.location,
233
+ isFromCheckout: route?.params?.isFromCheckout
232
234
  })}
233
235
  >
234
236
  <OIcon src={theme.images.general.pencil} width={16} style={{ marginHorizontal: 4 }} />
@@ -293,10 +295,7 @@ const AddressListUI = (props: AddressListParams) => {
293
295
  <OButton
294
296
  text={t('ADD_NEW_ADDRESS', 'Add new Address')}
295
297
  imgRightSrc=''
296
- bgColor={theme.colors.primary}
297
- textStyle={{ color: theme.colors.white }}
298
298
  style={styles.button}
299
- borderColor={theme.colors.primary}
300
299
  onClick={() => !afterSignup ? onNavigationRedirect(
301
300
  'AddressForm',
302
301
  {
@@ -305,7 +304,8 @@ const AddressListUI = (props: AddressListParams) => {
305
304
  addressesList: addressList?.addresses,
306
305
  nopadding: true,
307
306
  isSelectedAfterAdd: true,
308
- hasAddressDefault: !!orderState.options?.address?.location
307
+ hasAddressDefault: !!orderState.options?.address?.location,
308
+ isFromCheckout: route?.params?.isFromCheckout
309
309
  }) : onNavigationRedirect(
310
310
  'AddressFormInitial',
311
311
  {
@@ -314,7 +314,8 @@ const AddressListUI = (props: AddressListParams) => {
314
314
  addressesList: addressList?.addresses,
315
315
  nopadding: true,
316
316
  isSelectedAfterAdd: true,
317
- hasAddressDefault: !!orderState.options?.address?.location
317
+ hasAddressDefault: !!orderState.options?.address?.location,
318
+ isFormCheckout: route?.params?.isFromCheckout
318
319
  })}
319
320
  />
320
321
  </>
@@ -23,8 +23,7 @@ export const AnalyticsSegment = (props: any) => {
23
23
  segmentClient.track('Product List Viewed', {
24
24
  business_id: category?.business_id,
25
25
  category_id: category?.id,
26
- category: category?.name,
27
- products: category?.products
26
+ category: category?.name
28
27
  })
29
28
  }
30
29
 
@@ -62,11 +61,12 @@ export const AnalyticsSegment = (props: any) => {
62
61
  })
63
62
  }
64
63
 
65
- const handleProductAdded = (product: any) => {
64
+ const handleProductAdded = (product: any, result: any) => {
66
65
  segmentClient.track('Product Added', {
67
- id: product.id,
66
+ cart_id: result.uuid,
67
+ product_id: product.id,
68
68
  name: product.name,
69
- category: product.category_id,
69
+ category: product.category_id || product?.categoryId,
70
70
  price: product.price,
71
71
  quantity: product.quantity
72
72
  })
@@ -101,7 +101,7 @@ export const AnalyticsSegment = (props: any) => {
101
101
 
102
102
  const handleOrderPlaced = (order: any) => {
103
103
  segmentClient.track('Order Placed', {
104
- id: order.id,
104
+ order_id: order.id,
105
105
  affiliation: order.business?.name,
106
106
  revenue: order.total,
107
107
  tax: order.tax_total,
@@ -21,7 +21,7 @@ export const AppleLogin = (props: any) => {
21
21
  const [{ configs }] = useConfig();
22
22
  const [credentialStateForUser, updateCredentialStateForUser] = useState<any>(-1);
23
23
 
24
- let user : any= null
24
+ let user: any = null
25
25
 
26
26
  const buttonText = auth
27
27
  ? t('CONTINUE_WITH_APPLE', 'Logout with Apple')
@@ -53,7 +53,7 @@ export const AppleLogin = (props: any) => {
53
53
  }
54
54
  }
55
55
 
56
- const fetchAndUpdateCredentialState = async (updateCredentialStateForUser : any) => {
56
+ const fetchAndUpdateCredentialState = async (updateCredentialStateForUser: any) => {
57
57
  if (user === null) {
58
58
  updateCredentialStateForUser('N/A');
59
59
  } else {
@@ -66,7 +66,7 @@ export const AppleLogin = (props: any) => {
66
66
  }
67
67
  }
68
68
 
69
- const onIOSButtonPress = async (updateCredentialStateForUser : any) => {
69
+ const onIOSButtonPress = async (updateCredentialStateForUser: any) => {
70
70
  try {
71
71
  const appleAuthRequestResponse = await appleAuth.performRequest({
72
72
  requestedOperation: appleAuth.Operation.LOGIN,
@@ -79,7 +79,7 @@ export const AppleLogin = (props: any) => {
79
79
  identityToken,
80
80
  authorizationCode
81
81
  } = appleAuthRequestResponse;
82
-
82
+
83
83
  user = newUser;
84
84
 
85
85
  fetchAndUpdateCredentialState(updateCredentialStateForUser).catch(error =>
@@ -26,7 +26,6 @@ import {
26
26
  SocialListWrapper
27
27
  } from './styles';
28
28
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
29
- const types = ['food', 'laundry', 'alcohol', 'groceries'];
30
29
 
31
30
  let BusinessInformation: null | React.ElementType = null
32
31
  let BusinessReviews: null | React.ElementType = null
@@ -36,6 +35,7 @@ export const BusinessBasicInformation = (
36
35
  ) => {
37
36
  const { navigation, businessState, isBusinessInfoShow, logo, header, isPreOrder } = props;
38
37
  const { business, loading } = businessState;
38
+ const types = business?.types && business?.types?.filter(({ enabled }) => (enabled)).map(({ name }) => (name))
39
39
 
40
40
  const theme = useTheme();
41
41
  const [orderState] = useOrder();
@@ -146,14 +146,11 @@ export const BusinessBasicInformation = (
146
146
  }
147
147
 
148
148
  const getBusinessType = () => {
149
- if (Object.keys(business || {}).length <= 0) return t('GENERAL', 'General');
149
+ if (!types) return t('GENERAL', 'General');
150
150
  const _types: any = [];
151
151
  types.forEach(
152
- (type) =>
153
- business[type] &&
154
- _types.push(
155
- t(`BUSINESS_TYPE_${type?.replace(/\s/g, '_')?.toUpperCase()}`, type),
156
- ),
152
+ (type: any) =>
153
+ _types.push(type)
157
154
  );
158
155
  return _types.join(', ');
159
156
  };
@@ -247,7 +244,7 @@ export const BusinessBasicInformation = (
247
244
  <View style={styles.tiktokIcon}>
248
245
  <OIcon
249
246
  src={theme.images.general.tiktok}
250
- style={{ width: 10, height: 12 }}
247
+ style={{ width: 10, height: 12, bottom: 1 }}
251
248
  cover
252
249
  />
253
250
  </View>
@@ -455,7 +452,7 @@ export const BusinessBasicInformation = (
455
452
  </BusinessInfoItem>
456
453
  </View>
457
454
  <WrapReviews>
458
- {!isBusinessInfoShow && (
455
+ {!isBusinessInfoShow && !loading && (
459
456
  <>
460
457
  {isPreOrder && (!business?.professionals || business?.professionals?.length === 0) && (
461
458
  <>
@@ -35,7 +35,12 @@ import FastImage from 'react-native-fast-image'
35
35
  import { LottieAnimation } from '../LottieAnimation';
36
36
  import { CardAnimation } from '../shared/CardAnimation';
37
37
 
38
- export const BusinessControllerUI = (props: BusinessControllerParams) => {
38
+ function BusinessControllerPropsAreEqual(prevProps: any, nextProps: any) {
39
+ return JSON.stringify(prevProps.business) === JSON.stringify(nextProps.business) &&
40
+ prevProps.isBusinessOpen === nextProps.isBusinessOpen
41
+ }
42
+
43
+ export const BusinessControllerUI = React.memo((props: BusinessControllerParams) => {
39
44
  const {
40
45
  business,
41
46
  handleClick,
@@ -184,7 +189,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
184
189
  }
185
190
 
186
191
  return (
187
- <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
192
+ <View style={{ minHeight: 200 }}>
188
193
  {isIntersectionObserver ? (
189
194
  <CardAnimation
190
195
  style={[style, styles.container]}
@@ -227,7 +232,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
227
232
  </View>
228
233
  )}
229
234
  {!hideBusinessOffer && (
230
- getBusinessOffer((business?.offers)) &&
235
+ !!getBusinessOffer((business?.offers)) &&
231
236
  <OfferBox
232
237
  isClosed={!isBusinessOpen && (configState?.configs?.preorder_status_enabled?.value === '1')}
233
238
  isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}
@@ -239,7 +244,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
239
244
  numberOfLines={2}
240
245
  ellipsizeMode='tail'
241
246
  lineHeight={13}
242
- >{getBusinessOffer((business?.offers)) || parsePrice(0)}</OText>
247
+ >{t('DISCOUNT', 'Discount')}{' '}{getBusinessOffer((business?.offers))}</OText>
243
248
  </OfferBox>
244
249
  )}
245
250
  <BusinessState isRibbon={business?.ribbon?.enabled && !!business?.ribbon?.text}>
@@ -304,7 +309,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
304
309
  </ReviewAndFavorite>
305
310
  )}
306
311
  </View>
307
- <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={2}>
312
+ <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3, fontFamily: undefined }} numberOfLines={1}>
308
313
  {business?.address}
309
314
  </OText>
310
315
  <Metadata>
@@ -376,9 +381,9 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
376
381
  </View>
377
382
  </Placeholder>
378
383
  )}
379
- </InView>
384
+ </View>
380
385
  );
381
- };
386
+ }, BusinessControllerPropsAreEqual);
382
387
 
383
388
  export const BusinessController = (props: BusinessControllerParams) => {
384
389
  const BusinessControllerProps = {
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useRef, useEffect } from 'react';
2
- import { TouchableOpacity, View } from 'react-native';
2
+ import { TouchableOpacity, View, Vibration } from 'react-native';
3
3
  import { useOrder, useLanguage, useUtils, useConfig, useEvent } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import {
@@ -57,6 +57,9 @@ export const BusinessItemAccordion = (props: any) => {
57
57
  return acc = acc
58
58
  }, cart?.subtotal)
59
59
 
60
+ const bgStyle = (subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary
61
+ const textStyles = (subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.black : theme.colors.white
62
+
60
63
  useEffect(() => {
61
64
  if (isActive && !isFromUpselling) {
62
65
  if (cart?.uuid !== viewedCart?.uuid) {
@@ -66,6 +69,11 @@ export const BusinessItemAccordion = (props: any) => {
66
69
  }
67
70
  }, [isActive, viewedCart])
68
71
 
72
+ const handleGoToStore = () => {
73
+ Vibration.vibrate(100)
74
+ props.onNavigationRedirect('Business', { store: cart?.business?.slug })
75
+ }
76
+
69
77
  return (
70
78
  <BIContainer isClosed={isClosed} isMultiCheckout={isMultiCheckout} checkoutVisible={!isActive && !isClosed && !!isProducts && !checkoutButtonDisabled}>
71
79
  <BIHeader
@@ -79,7 +87,7 @@ export const BusinessItemAccordion = (props: any) => {
79
87
  <View style={{ flexDirection: 'row' }}>
80
88
  {props.onNavigationRedirect && !isClosed && !isGiftCart && (
81
89
  <>
82
- <TouchableOpacity onPress={() => props.onNavigationRedirect('Business', { store: cart?.business?.slug })}>
90
+ <TouchableOpacity onPress={() => handleGoToStore()}>
83
91
  <OText color={theme.colors.primary} size={12} lineHeight={18} style={{ textDecorationLine: 'underline' }}>{t('GO_TO_STORE', 'Go to store')}</OText>
84
92
  </TouchableOpacity>
85
93
  </>
@@ -153,11 +161,11 @@ export const BusinessItemAccordion = (props: any) => {
153
161
  {cart?.valid_products && (
154
162
  <OButton
155
163
  onClick={handleClickCheckout}
156
- textStyle={{ color: 'white', textAlign: 'center', flex: 1 }}
164
+ textStyle={{ color: textStyles, textAlign: 'center', flex: 1 }}
157
165
  style={{ width: 180, flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
158
166
  text={t('CHECKOUT', 'Checkout')}
159
- bgColor={(subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? theme.colors.secundary : theme.colors.primary}
160
- borderColor={theme.colors.primary}
167
+ bgColor={bgStyle}
168
+ borderColor={bgStyle}
161
169
  isDisabled={checkoutButtonDisabled}
162
170
  />
163
171
  )}
@@ -243,7 +243,7 @@ export const BusinessSearchFooter = (props: any) => {
243
243
  onClick={() => handleChangePriceRange(price?.level)}
244
244
  text={`${price.content} ${(filters?.price_level === price?.level) ? ' X' : ''}`}
245
245
  style={styles.priceItem}
246
- textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
246
+ textStyle={{ fontSize: 10, color: (filters?.price_level === price?.level) ? theme.colors.white : theme.colors.textNormal }}
247
247
  />
248
248
  ))}
249
249
  </View>
@@ -284,7 +284,7 @@ export const BusinessSearchFooter = (props: any) => {
284
284
  onClick={() => handleChangeActiveBusinessType(type)}
285
285
  text={`${t(`BUSINESS_TYPE_${type.name.replace(/\s/g, '_').toUpperCase()}`, type.name)} ${filters?.business_types?.includes(type?.id) ? 'X' : ''}`}
286
286
  style={styles.categoryStyle}
287
- textStyle={{ fontSize: 10, color: (filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? '#fff' : theme.colors.textNormal }}
287
+ textStyle={{ fontSize: 10, color: (filters?.business_types?.includes(type?.id) || (type?.id === null && filters?.business_types?.length === 0)) ? theme.colors.white : theme.colors.textNormal }}
288
288
  />
289
289
  ))}
290
290
  </View>
@@ -296,7 +296,6 @@ export const BusinessSearchFooter = (props: any) => {
296
296
  <OButton
297
297
  text={t('APPLY', 'Apply')}
298
298
  parentStyle={styles.applyButton}
299
- textStyle={{ color: '#fff' }}
300
299
  onClick={() => handleApplyFilters()}
301
300
  />
302
301
  </View>
@@ -47,13 +47,11 @@ export const BusinessSearchHeader = (props: any) => {
47
47
  borderWidth: 0,
48
48
  width: 26,
49
49
  height: 26,
50
- backgroundColor: '#FFF',
51
- borderColor: '#FFF',
52
- shadowColor: '#FFF',
53
50
  paddingLeft: 0,
54
51
  paddingRight: 0,
55
52
  marginTop: 50,
56
53
  }}
54
+ useArrow
57
55
  onClick={() => props.navigation.goBack()}
58
56
  icon={AntDesignIcon}
59
57
  iconProps={{
@@ -230,7 +230,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
230
230
  </BusinessInfoItem>
231
231
  <OButton
232
232
  onClick={() => onBusinessClick(business)}
233
- textStyle={{ color: theme.colors.primary, fontSize: 10 }}
233
+ textStyle={{ fontSize: 10 }}
234
234
  text={t('GO_TO_STORE', 'Go to store')}
235
235
  style={{
236
236
  borderRadius: 23,
@@ -238,7 +238,6 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
238
238
  paddingRight: 10,
239
239
  height: 23,
240
240
  shadowOpacity: 0,
241
- backgroundColor: theme.colors.primaryContrast,
242
241
  borderWidth: 0
243
242
  }}
244
243
  />
@@ -11,6 +11,8 @@ import { BusinessMenuList } from '../BusinessMenuList'
11
11
  import Spinner from 'react-native-loading-spinner-overlay'
12
12
  import { BusinessPreorderParams } from '../../types'
13
13
  import moment from 'moment'
14
+ import { setLocalMoment } from '../../utils';
15
+
14
16
  import SelectDropdown from 'react-native-select-dropdown'
15
17
  import {
16
18
  PreOrderContainer,
@@ -311,6 +313,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
311
313
  }
312
314
  }, [dateSelected])
313
315
 
316
+ useEffect(() => {
317
+ setLocalMoment(moment, t)
318
+ }, [])
319
+
314
320
  useFocusEffect(
315
321
  React.useCallback(() => {
316
322
  handleAsap && handleAsap()
@@ -527,7 +533,6 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
527
533
  )}
528
534
  <OButton
529
535
  text={t('GO_TO_MENU', 'Go to menu')}
530
- textStyle={{ color: 'white' }}
531
536
  style={{ borderRadius: 7.6, marginBottom: 20, marginTop: 30 }}
532
537
  onClick={() => handleClickBusiness()}
533
538
  isDisabled={isAsap || !(dateSelected && timeSelected)}
@@ -553,21 +558,21 @@ export const BusinessPreorder = (props: any) => {
553
558
  currentDate.setMinutes(59)
554
559
 
555
560
  const cateringTypeString = orderState?.options?.type === 7
556
- ? 'catering_delivery'
557
- : orderState?.options?.type === 8
558
- ? 'catering_pickup'
559
- : null
561
+ ? 'catering_delivery'
562
+ : orderState?.options?.type === 8
563
+ ? 'catering_pickup'
564
+ : null
560
565
 
561
- const splitCateringValue = (configName : string) =>
562
- Object.values(props?.business?.configs || {})
563
- ?.find(config => config?.key === configName)
564
- ?.value?.split('|')
565
- ?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
566
- const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
567
- const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
568
- const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
569
- const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
570
- const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
566
+ const splitCateringValue = (configName: string) =>
567
+ Object.values(props?.business?.configs || {})
568
+ ?.find(config => config?.key === configName)
569
+ ?.value?.split('|')
570
+ ?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
571
+ const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
572
+ const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
573
+ const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
574
+ const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
575
+ const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
571
576
 
572
577
  const businessPreorderProps = {
573
578
  ...props,
@@ -16,7 +16,7 @@ interface SubcategoriesComponentParams {
16
16
  onClickSubcategory: any
17
17
  }
18
18
 
19
- const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
19
+ const SubcategoriesComponent = (props: SubcategoriesComponentParams) => {
20
20
  const {
21
21
  subcategoriesSelected,
22
22
  category,
@@ -56,10 +56,10 @@ const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
56
56
  >
57
57
  <OButton
58
58
  onClick={() => onClickSubcategory(null, category)}
59
- bgColor={allsubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
60
59
  text={`${t('ALL', 'All')} ${allsubcategorySelected ? 'X' : ''}`}
61
60
  style={bpStyles.categoryButtonStyle}
62
- textStyle={{ color: allsubcategorySelected ? theme.colors.white : theme.colors.textNormal, fontSize: 12 }}
61
+ textStyle={{ fontSize: 12 }}
62
+ isDisabled={!allsubcategorySelected}
63
63
  />
64
64
  </ContainerButton>
65
65
  {category?.subcategories?.map((subcategory: any) => {
@@ -71,10 +71,10 @@ const SubcategoriesComponent = (props : SubcategoriesComponentParams) => {
71
71
  >
72
72
  <OButton
73
73
  onClick={() => onClickSubcategory(subcategory, category)}
74
- bgColor={isSubcategorySelected ? theme.colors.primary : theme.colors.backgroundGray}
75
74
  text={`${subcategory?.name} ${isSubcategorySelected ? 'X' : ''}`}
76
75
  style={bpStyles.categoryButtonStyle}
77
- textStyle={{ color: isSubcategorySelected ? theme.colors.white : theme.colors.textNormal, fontSize: 12 }}
76
+ textStyle={{ fontSize: 12 }}
77
+ isDisabled={!allsubcategorySelected}
78
78
  />
79
79
  </ContainerButton>
80
80
  )
@@ -214,11 +214,11 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
214
214
  text={t('VIEW_MORE', 'View more')}
215
215
  parentStyle={{ padding: 0 }}
216
216
  onClick={() => setOpenDescription(category)}
217
- bgColor='transparent'
217
+ bgColor={theme.colors.white}
218
+ borderColor={theme.colors.primary}
218
219
  textStyle={{
219
220
  fontSize: 12,
220
221
  borderBottomWidth: 1,
221
- borderBottomColor: theme.colors.primary,
222
222
  color: theme.colors.primary
223
223
  }}
224
224
  />
@@ -18,15 +18,12 @@ export const RibbonBox = styled.View`
18
18
  background-color: ${(props: any) => props.theme.colors.primary};
19
19
  padding: 2px 8px;
20
20
  max-width: 180px;
21
-
22
21
  ${(props: any) => props.bgColor && css`
23
22
  background-color: ${props.bgColor};
24
23
  `}
25
-
26
24
  ${(props: any) => props.isRoundRect && css`
27
25
  border-radius: 7.6px;
28
26
  `}
29
-
30
27
  ${(props: any) => props.isCapsule && css`
31
28
  border-radius: 50px;
32
29
  `}
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react'
2
- import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler, ScrollView } from 'react-native'
2
+ import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler, ScrollView, Vibration } from 'react-native'
3
3
  import { IOScrollView } from 'react-native-intersection-observer'
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
5
5
  import { useTheme } from 'styled-components/native';
@@ -225,8 +225,9 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
225
225
  cartUuid: cart?.uuid,
226
226
  businessLogo: cart?.business?.logo,
227
227
  businessName: cart?.business?.name,
228
- cartTotal: cart?.total
229
- }, true)
228
+ cartTotal: cart?.total,
229
+ fromProductsList: true
230
+ })
230
231
  } else {
231
232
  const groupKeys: any = {}
232
233
  cartsAvailable.forEach((_cart: any) => {
@@ -242,12 +243,12 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
242
243
  props.onNavigationRedirect('CheckoutNavigator', {
243
244
  screen: 'MultiCheckout',
244
245
  checkCarts: true
245
- }, true)
246
+ })
246
247
  } else {
247
248
  props.onNavigationRedirect('CheckoutNavigator', {
248
249
  screen: 'MultiCheckout',
249
250
  cartUuid: cartsAvailable[0]?.group?.uuid
250
- }, true)
251
+ })
251
252
  }
252
253
  }
253
254
  }
@@ -381,6 +382,14 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
381
382
  setViewedCategory(_viewedCategory)
382
383
  events.emit('product_list_viewed', _viewedCategory)
383
384
  }
385
+ } else {
386
+ if (business.categories) {
387
+ const categoryAll: any = {}
388
+ categoryAll.business_id = business.id
389
+ categoryAll.id = null
390
+ categoryAll.name = 'All'
391
+ events.emit('product_list_viewed', categoryAll)
392
+ }
384
393
  }
385
394
  }, [business?.lazy_load_products_recommended, selectedCategoryId, categorySelected?.id, viewedCategory])
386
395
 
@@ -679,7 +688,10 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
679
688
  btnLeftValue={currentCart?.products.reduce((prev: number, product: any) => prev + product.quantity, 0)}
680
689
  btnRightValue={parsePrice(currentCart?.total)}
681
690
  disabled={subtotalWithTaxes < currentCart?.minimum || openUpselling}
682
- handleClick={() => setOpenUpselling(true)}
691
+ handleClick={() => {
692
+ Vibration.vibrate(100)
693
+ setOpenUpselling(true)
694
+ }}
683
695
  />
684
696
  </View>
685
697
  )}
@@ -26,9 +26,9 @@ import { BusinessTypeFilterParams } from '../../types';
26
26
  const windowWidth = Dimensions.get('window').width;
27
27
 
28
28
  export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
29
- const {
30
- typesState,
31
- currentTypeSelected,
29
+ const {
30
+ typesState,
31
+ currentTypeSelected,
32
32
  handleChangeBusinessType,
33
33
  setBusinessTypes,
34
34
  isAppoint
@@ -38,13 +38,13 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
38
38
 
39
39
  const theme = useTheme();
40
40
  const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
41
- const defaultImage = (name : string) => theme.images?.categories?.[name.toLowerCase().replace(' ', '')]
41
+ const defaultImage = (name: string) => theme.images?.categories?.[name.toLowerCase().replace(' ', '')]
42
42
 
43
43
  useEffect(() => {
44
- if(typesState?.types?.length > 0){
45
- setBusinessTypes && setBusinessTypes(typesState?.types)
44
+ if (typesState?.types?.length > 0) {
45
+ setBusinessTypes && setBusinessTypes(typesState?.types)
46
46
  }
47
- }, [typesState])
47
+ }, [typesState])
48
48
 
49
49
  const handleChangeServiceType = (serviceId: any) => {
50
50
  if (serviceId === currentTypeSelected) {
@@ -119,10 +119,11 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
119
119
  <OButton
120
120
  key={i}
121
121
  bgColor={(currentTypeSelected === businessType?.id) ? theme.colors.primary : theme.colors.backgroundGray200}
122
+ borderColor={(currentTypeSelected === businessType?.id) ? theme.colors.primary : theme.colors.backgroundGray200}
122
123
  onClick={() => handleChangeServiceType(businessType?.id)}
123
124
  text={`${businessType?.name} ${(currentTypeSelected === businessType?.id) ? ' X' : ''}`}
124
125
  style={styles.businessType}
125
- textStyle={{ fontSize: 10, color: (currentTypeSelected === businessType?.id) ? theme.colors.backgroundLight : theme.colors.textNormal }}
126
+ textStyle={{ fontSize: 10, color: (currentTypeSelected === businessType?.id) ? theme.colors.white : theme.colors.textNormal }}
126
127
  />
127
128
  ))}
128
129
  </ServiceWrapper>
@@ -392,10 +392,11 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
392
392
  <OButton
393
393
  key={i}
394
394
  bgColor={(priceLevelSelected === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
395
+ borderColor={(priceLevelSelected === price?.level) ? theme.colors.primary : theme.colors.backgroundGray200}
395
396
  onClick={() => handleChangePriceLevel(price?.level)}
396
397
  text={`${price.content} ${(priceLevelSelected === price?.level) ? ' X' : ''}`}
397
398
  style={styles.priceLevel}
398
- textStyle={{ fontSize: 10, color: (priceLevelSelected === price?.level) ? theme.colors.backgroundLight : theme.colors.textNormal }}
399
+ textStyle={{ fontSize: 10, color: (priceLevelSelected === price?.level) ? theme.colors.backgroundLight : theme.colors.black }}
399
400
  />
400
401
  ))}
401
402
  </ScrollView>
@@ -168,7 +168,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
168
168
  setFeaturedBusinesses(ary);
169
169
  }
170
170
  resetInactivityTimeout()
171
- }, [businessesList.loading])
171
+ }, [businessesList.loading, businessesList?.businesses])
172
172
 
173
173
  const handleOnRefresh = () => {
174
174
  if (!businessesList.loading) {
@@ -60,7 +60,7 @@ export const WrapMomentOption = styled.TouchableOpacity`
60
60
 
61
61
  export const HeaderWrapper = styled.ImageBackground`
62
62
  width: 100%;
63
- height: ${({ bgHeaderHeight } : any) => bgHeaderHeight || '270px'};
63
+ height: 270px;
64
64
  padding: 20px;
65
65
  background-color: transparent;
66
66
  `;
@@ -1,4 +1,3 @@
1
-
2
1
  import React, { useState, useEffect } from 'react'
3
2
  import { useOrder, useSession, useLanguage, useConfig } from 'ordering-components/native';
4
3