ordering-ui-react-native 0.17.53 → 0.17.54-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 (217) hide show
  1. package/package.json +8 -7
  2. package/src/DeliveryApp.tsx +43 -1
  3. package/src/components/BusinessesListing/index.tsx +1 -1
  4. package/src/components/OrderCreating/index.tsx +1 -21
  5. package/src/components/PaymentOptionsWebView/index.tsx +29 -8
  6. package/src/components/PhoneInputNumber/index.tsx +6 -2
  7. package/src/components/StripeMethodForm/index.tsx +136 -102
  8. package/src/components/VerifyPhone/styles.tsx +1 -2
  9. package/src/components/shared/OToast.tsx +4 -4
  10. package/src/types/index.tsx +5 -0
  11. package/src/utils/index.tsx +5 -0
  12. package/themes/business/index.tsx +2 -0
  13. package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +265 -240
  14. package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
  15. package/themes/business/src/components/BusinessController/index.tsx +0 -1
  16. package/themes/business/src/components/Chat/index.tsx +125 -113
  17. package/themes/business/src/components/DriverMap/index.tsx +17 -6
  18. package/themes/business/src/components/DriverSchedule/index.tsx +29 -2
  19. package/themes/business/src/components/GoogleMap/index.tsx +58 -57
  20. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  21. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  22. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  23. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  24. package/themes/business/src/components/MapView/index.tsx +10 -10
  25. package/themes/business/src/components/NewOrderNotification/index.tsx +35 -21
  26. package/themes/business/src/components/OrderDetails/Delivery.tsx +191 -6
  27. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +93 -50
  28. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +63 -62
  29. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  30. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  31. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  32. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  33. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  34. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +249 -0
  35. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  36. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  37. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  38. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  39. package/themes/business/src/components/ReviewCustomer/index.tsx +30 -15
  40. package/themes/business/src/components/StoresList/index.tsx +2 -2
  41. package/themes/business/src/components/UserProfileForm/index.tsx +11 -13
  42. package/themes/business/src/components/shared/OLink.tsx +33 -13
  43. package/themes/business/src/components/shared/OModal.tsx +16 -9
  44. package/themes/business/src/components/shared/OText.tsx +8 -2
  45. package/themes/business/src/types/index.tsx +32 -2
  46. package/themes/business/src/utils/index.tsx +44 -1
  47. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  48. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  49. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  50. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  51. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  52. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  53. package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
  54. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  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/PhoneInputNumber/index.tsx +3 -2
  59. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  60. package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
  61. package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
  62. package/themes/kiosk/src/layouts/Container.tsx +7 -1
  63. package/themes/kiosk/src/types/index.d.ts +13 -0
  64. package/themes/kiosk/src/utils/index.tsx +15 -0
  65. package/themes/original/index.tsx +4 -0
  66. package/themes/original/src/components/AddressDetails/index.tsx +28 -10
  67. package/themes/original/src/components/AddressForm/index.tsx +68 -40
  68. package/themes/original/src/components/AddressList/index.tsx +27 -22
  69. package/themes/original/src/components/AddressList/styles.tsx +4 -2
  70. package/themes/original/src/components/AnalyticsSegment/index.tsx +193 -10
  71. package/themes/original/src/components/AppleLogin/index.tsx +4 -4
  72. package/themes/original/src/components/AppleLogin/styles.tsx +3 -1
  73. package/themes/original/src/components/BusinessBasicInformation/index.tsx +152 -95
  74. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  75. package/themes/original/src/components/BusinessController/index.tsx +122 -68
  76. package/themes/original/src/components/BusinessController/styles.tsx +23 -4
  77. package/themes/original/src/components/BusinessFeaturedController/index.tsx +21 -54
  78. package/themes/original/src/components/BusinessFeaturedController/styles.tsx +8 -0
  79. package/themes/original/src/components/BusinessInformation/index.tsx +110 -108
  80. package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -20
  81. package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
  82. package/themes/original/src/components/BusinessPreorder/index.tsx +103 -19
  83. package/themes/original/src/components/BusinessProductsCategories/index.tsx +1 -2
  84. package/themes/original/src/components/BusinessProductsList/index.tsx +25 -15
  85. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  86. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  87. package/themes/original/src/components/BusinessProductsListing/index.tsx +668 -514
  88. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  89. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +97 -91
  92. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -4
  93. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  94. package/themes/original/src/components/Cart/index.tsx +77 -50
  95. package/themes/original/src/components/CartContent/index.tsx +115 -19
  96. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  97. package/themes/original/src/components/Checkout/index.tsx +359 -171
  98. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  99. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  100. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  101. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  102. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  103. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  104. package/themes/original/src/components/Favorite/index.tsx +8 -9
  105. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  106. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  107. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  108. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  109. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  110. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  111. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  112. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  113. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  114. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  115. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  116. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  117. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  118. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  119. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  120. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  121. package/themes/original/src/components/Help/index.tsx +8 -8
  122. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  123. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  124. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  125. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  126. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  127. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  128. package/themes/original/src/components/Home/index.tsx +13 -4
  129. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  130. package/themes/original/src/components/LoginForm/Otp/index.tsx +55 -13
  131. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  132. package/themes/original/src/components/LoginForm/index.tsx +64 -26
  133. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  134. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  135. package/themes/original/src/components/Messages/index.tsx +32 -10
  136. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  137. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  138. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
  139. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  140. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  141. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  142. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  143. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  144. package/themes/original/src/components/MyOrders/index.tsx +77 -52
  145. package/themes/original/src/components/NavBar/index.tsx +18 -18
  146. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  147. package/themes/original/src/components/Notifications/index.tsx +46 -50
  148. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  149. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  150. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  151. package/themes/original/src/components/OrderDetails/index.tsx +190 -358
  152. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  153. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  154. package/themes/original/src/components/OrderProgress/index.tsx +33 -59
  155. package/themes/original/src/components/OrderSummary/index.tsx +85 -57
  156. package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
  157. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +24 -19
  158. package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +14 -14
  159. package/themes/original/src/components/OrdersOption/index.tsx +76 -66
  160. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  161. package/themes/original/src/components/PageBanner/index.tsx +107 -40
  162. package/themes/original/src/components/PageBanner/styles.tsx +4 -1
  163. package/themes/original/src/components/PaymentOptionCard/index.tsx +180 -0
  164. package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
  165. package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
  166. package/themes/original/src/components/PaymentOptions/index.tsx +64 -7
  167. package/themes/original/src/components/PhoneInputNumber/index.tsx +3 -3
  168. package/themes/original/src/components/PlaceSpot/index.tsx +12 -6
  169. package/themes/original/src/components/ProductForm/index.tsx +109 -33
  170. package/themes/original/src/components/ProductForm/styles.tsx +5 -7
  171. package/themes/original/src/components/ProductItemAccordion/index.tsx +22 -19
  172. package/themes/original/src/components/ProductOptionSubOption/index.tsx +24 -14
  173. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +3 -4
  174. package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
  175. package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -50
  176. package/themes/original/src/components/ProfessionalProfile/index.tsx +36 -7
  177. package/themes/original/src/components/Promotions/index.tsx +234 -220
  178. package/themes/original/src/components/Promotions/styles.tsx +10 -3
  179. package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
  180. package/themes/original/src/components/ReviewOrder/index.tsx +26 -9
  181. package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
  182. package/themes/original/src/components/ReviewProducts/index.tsx +23 -11
  183. package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
  184. package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
  185. package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
  186. package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
  187. package/themes/original/src/components/ServiceForm/index.tsx +66 -17
  188. package/themes/original/src/components/Sessions/index.tsx +11 -8
  189. package/themes/original/src/components/Sessions/styles.tsx +5 -0
  190. package/themes/original/src/components/SignupForm/index.tsx +43 -20
  191. package/themes/original/src/components/SingleOrderCard/index.tsx +130 -52
  192. package/themes/original/src/components/SingleOrderCard/styles.tsx +11 -2
  193. package/themes/original/src/components/SingleProductCard/index.tsx +71 -34
  194. package/themes/original/src/components/SingleProductCard/styles.tsx +21 -4
  195. package/themes/original/src/components/SingleProductReview/styles.tsx +1 -1
  196. package/themes/original/src/components/StripeCardsList/index.tsx +13 -3
  197. package/themes/original/src/components/StripeElementsForm/index.tsx +48 -34
  198. package/themes/original/src/components/UpsellingProducts/index.tsx +238 -224
  199. package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
  200. package/themes/original/src/components/UserDetails/index.tsx +8 -4
  201. package/themes/original/src/components/UserFormDetails/index.tsx +76 -7
  202. package/themes/original/src/components/UserFormDetails/styles.tsx +1 -1
  203. package/themes/original/src/components/UserProfile/index.tsx +88 -79
  204. package/themes/original/src/components/UserProfileForm/index.tsx +27 -29
  205. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  206. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  207. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  208. package/themes/original/src/components/Wallets/index.tsx +67 -24
  209. package/themes/original/src/components/Wallets/styles.tsx +3 -4
  210. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  211. package/themes/original/src/components/shared/OButton.tsx +6 -2
  212. package/themes/original/src/components/shared/OInput.tsx +6 -1
  213. package/themes/original/src/components/shared/OModal.tsx +3 -3
  214. package/themes/original/src/layouts/Container.tsx +1 -1
  215. package/themes/original/src/types/index.tsx +40 -11
  216. package/themes/original/src/utils/index.tsx +375 -58
  217. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,7 +1,8 @@
1
1
  import React, { useState, useEffect } from 'react'
2
+ import { useFocusEffect } from '@react-navigation/native'
2
3
  import { TouchableOpacity, StyleSheet, View, Dimensions, Platform } from 'react-native'
3
4
  import { useLanguage, useUtils, useConfig, useOrder, MomentOption } from 'ordering-components/native'
4
- import { OButton, OText } from '../shared'
5
+ import { OButton, OIcon, OText } from '../shared'
5
6
  import { useTheme } from 'styled-components/native'
6
7
  import IconAntDesign from 'react-native-vector-icons/AntDesign'
7
8
  import FastImage from 'react-native-fast-image'
@@ -37,7 +38,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
37
38
  handleChangeDate,
38
39
  handleChangeTime,
39
40
  handleAsap,
40
- isAsap
41
+ getActualSchedule,
42
+ isAsap,
43
+ cateringPreorder,
44
+ preorderLeadTime
41
45
  } = props
42
46
 
43
47
  const theme = useTheme()
@@ -52,6 +56,8 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
52
56
  const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
53
57
  const [isEnabled, setIsEnabled] = useState(false)
54
58
  const { top } = useSafeAreaInsets()
59
+ const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
60
+
55
61
  const showOrderTime = (selectedPreorderType === 1 && Object.keys(menu)?.length > 0) || selectedPreorderType === 0
56
62
  const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
57
63
  const styles = StyleSheet.create({
@@ -165,7 +171,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
165
171
  if (date.getDate() !== dateSeleted.getDate() || i >= date.getHours()) {
166
172
  let hour = ''
167
173
  let meridian = ''
168
- if (configs?.format_time?.value === '12') {
174
+ if (is12hours) {
169
175
  if (i === 0) {
170
176
  hour = '12'
171
177
  meridian = ' ' + t('AM', 'AM')
@@ -252,10 +258,45 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
252
258
 
253
259
  useEffect(() => {
254
260
  if (selectDate === null) return
255
- const selectedMenu = Object.keys(menu).length > 0 ? (menu?.use_business_schedule ? business : menu) : business
256
- const _times = getTimes(selectDate, selectedMenu)
257
- setTimeList(_times)
258
- }, [selectDate, menu])
261
+ if (cateringPreorder) {
262
+ let _timeLists = []
263
+ const schedule = business && getActualSchedule()
264
+ if (!schedule && cateringPreorder && Object.keys(business)?.length > 0) {
265
+ return
266
+ }
267
+ _timeLists = hoursList
268
+ .filter(hour => ((Object.keys(business || {})?.length === 0) || schedule?.lapses?.some((lapse: any) =>
269
+ moment(dateSelected + ` ${hour.startTime}`) >= moment(dateSelected + ` ${lapse.open.hour}:${lapse.open.minute}`).add(preorderLeadTime, 'minutes') && moment(dateSelected + ` ${hour.endTime}`) <= moment(dateSelected + ` ${lapse.close.hour}:${lapse.close.minute}`))) &&
270
+ moment(dateSelected + ` ${hour.startTime}`) < moment(dateSelected + ` ${hour.endTime}`) &&
271
+ (moment().add(preorderLeadTime, 'minutes') < moment(dateSelected + ` ${hour.startTime}`) || !cateringPreorder))
272
+ .map(hour => {
273
+ return {
274
+ value: hour.startTime,
275
+ text: is12hours ? (
276
+ hour.startTime.includes('12')
277
+ ? `${hour.startTime}PM`
278
+ : parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
279
+ ) : (
280
+ parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'HH:mm' })
281
+ ),
282
+ endText: is12hours ? (
283
+ hour.endTime.includes('12')
284
+ ? `${hour.endTime}PM`
285
+ : parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'hh:mma' })
286
+ ) : (
287
+ parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'HH:mm' })
288
+ )
289
+ }
290
+ })
291
+ if (_timeLists?.length > 0) {
292
+ setTimeList(_timeLists)
293
+ }
294
+ } else {
295
+ const selectedMenu = Object.keys(menu).length > 0 ? (menu?.use_business_schedule ? business : menu) : business
296
+ const _times = getTimes(selectDate, selectedMenu)
297
+ setTimeList(_times)
298
+ }
299
+ }, [selectDate, menu, business, cateringPreorder, hoursList, dateSelected])
259
300
 
260
301
  useEffect(() => {
261
302
  if (selectedPreorderType === 0 && Object.keys(menu).length > 0) setMenu({})
@@ -263,15 +304,18 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
263
304
 
264
305
  useEffect(() => {
265
306
  if (dateSelected) {
307
+
266
308
  const dateParts = dateSelected.split('-')
267
309
  const _dateSelected = new Date(dateParts[0], dateParts[1] - 1, dateParts[2])
268
310
  setSelectedDate(_dateSelected)
269
311
  }
270
312
  }, [dateSelected])
271
313
 
272
- useEffect(() => {
273
- handleAsap && handleAsap()
274
- }, [])
314
+ useFocusEffect(
315
+ React.useCallback(() => {
316
+ handleAsap && handleAsap()
317
+ }, [])
318
+ )
275
319
 
276
320
  return (
277
321
  <>
@@ -302,7 +346,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
302
346
  />
303
347
  </View>
304
348
  </BusinessInfoWrapper>
305
- {isPreOrderSetting && (
349
+ {isPreOrderSetting && !cateringPreorder && (
306
350
  <PreorderTypeWrapper>
307
351
  <OText
308
352
  size={16}
@@ -415,19 +459,36 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
415
459
  />
416
460
  )}
417
461
  </View>
418
- <TimeListWrapper nestedScrollEnabled={true}>
419
- {(isEnabled && timeList?.length > 0) ? (
462
+ <TimeListWrapper nestedScrollEnabled={true} cateringPreorder={cateringPreorder}>
463
+ {((isEnabled || cateringPreorder) && timeList?.length > 0) ? (
420
464
  <TimeContentWrapper>
421
465
  {timeList.map((time: any, i: number) => (
422
466
  <TouchableOpacity key={i} onPress={() => handleChangeTime(time.value)}>
423
- <TimeItem active={timeSelected === time.value}>
467
+ <TimeItem active={timeSelected === time.value} cateringPreorder={cateringPreorder}>
468
+ {cateringPreorder && (
469
+ <>
470
+ {timeSelected === time.value ? (
471
+ <OIcon
472
+ src={theme.images.general.option_checked}
473
+ width={18}
474
+ style={{ marginEnd: 24, bottom: 2 }}
475
+ />
476
+ ) : (
477
+ <OIcon
478
+ src={theme.images.general.option_normal}
479
+ width={18}
480
+ style={{ marginEnd: 24, bottom: 2 }}
481
+ />
482
+ )}
483
+ </>
484
+ )}
424
485
  <OText
425
- size={14}
486
+ size={cateringPreorder ? 18 : 16}
426
487
  color={timeSelected === time.value ? theme.colors.primary : theme.colors.textNormal}
427
488
  style={{
428
489
  lineHeight: 24
429
490
  }}
430
- >{time.text}</OText>
491
+ >{time.text} {cateringPreorder && `- ${time.endText}`}</OText>
431
492
  </TimeItem>
432
493
  </TouchableOpacity>
433
494
  ))}
@@ -461,7 +522,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
461
522
  marginBottom: 12,
462
523
  textAlign: 'center'
463
524
  }}
464
- >
525
+ >
465
526
  {t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
466
527
  </OText>
467
528
  )}
@@ -480,7 +541,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
480
541
 
481
542
  export const BusinessPreorder = (props: any) => {
482
543
  const [{ configs }] = useConfig()
483
-
544
+ const [orderState] = useOrder()
484
545
  const limitDays = parseInt(configs?.max_days_preorder?.value, 10)
485
546
 
486
547
  const currentDate = new Date()
@@ -492,10 +553,33 @@ export const BusinessPreorder = (props: any) => {
492
553
  currentDate.setHours(23)
493
554
  currentDate.setMinutes(59)
494
555
 
556
+ const cateringTypeString = orderState?.options?.type === 7
557
+ ? 'catering_delivery'
558
+ : orderState?.options?.type === 8
559
+ ? 'catering_pickup'
560
+ : null
561
+
562
+ const splitCateringValue = (configName : string) =>
563
+ Object.values(props?.business?.configs || {})
564
+ ?.find(config => config?.key === configName)
565
+ ?.value?.split('|')
566
+ ?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
567
+ const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
568
+ const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
569
+ const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
570
+ const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
571
+ const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
572
+
495
573
  const businessPreorderProps = {
496
574
  ...props,
497
575
  UIComponent: BusinessPreorderUI,
498
- maxDate: currentDate
576
+ maxDate: currentDate,
577
+ preorderLeadTime,
578
+ preorderSlotInterval,
579
+ preorderTimeRange,
580
+ preorderMaximumDays,
581
+ preorderMinimumDays,
582
+ cateringPreorder: !!cateringTypeString
499
583
  }
500
584
  return <MomentOption {...businessPreorderProps} />
501
585
  }
@@ -107,8 +107,7 @@ const BusinessProductsCategoriesUI = (props: any) => {
107
107
  </Placeholder>
108
108
  )}
109
109
  {!loading &&
110
- categories &&
111
- categories.length &&
110
+ categories?.length > 0 &&
112
111
  categories.map((category: any) => (
113
112
  <Tab
114
113
  key={category.id}
@@ -9,7 +9,7 @@ import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
9
9
  import { View, ScrollView } from 'react-native';
10
10
  import { StyleSheet } from 'react-native';
11
11
  import { useTheme } from 'styled-components/native';
12
- import { shape } from '../../utils'
12
+ import { lightenDarkenColor, shape } from '../../utils'
13
13
  import { CategoryDescriptionMemoized } from './CategoryDescription';
14
14
  import { OrderItAgain } from '../OrderItAgain'
15
15
  import { SubcategoriesComponentMemoized } from './SubcategoriesComponent';
@@ -39,7 +39,8 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
39
39
  handleUpdateProducts,
40
40
  previouslyProducts,
41
41
  isFiltMode,
42
- navigation
42
+ navigation,
43
+ businessSingleId
43
44
  } = props;
44
45
 
45
46
  const [, t] = useLanguage();
@@ -92,6 +93,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
92
93
  handleUpdateProducts={handleUpdateProducts}
93
94
  currentCart={currentCart}
94
95
  searchValue={searchValue}
96
+ businessSingleId={businessSingleId}
95
97
  />
96
98
  )}
97
99
  {category.id &&
@@ -104,7 +106,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
104
106
  <SingleProductCard
105
107
  key={'prod_' + product.id + `_${i}`}
106
108
  isSoldOut={product.inventoried && !product.quantity}
107
- enableIntersection={!isFiltMode && categoryState.products?.length < 80}
109
+ enableIntersection={!isFiltMode}
108
110
  product={product}
109
111
  businessId={businessId}
110
112
  categoryState={categoryState}
@@ -112,6 +114,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
112
114
  productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
113
115
  handleUpdateProducts={handleUpdateProducts}
114
116
  navigation={navigation}
117
+ businessSingleId={businessSingleId}
115
118
  />
116
119
  ))
117
120
  }
@@ -132,13 +135,14 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
132
135
  key={'feat_' + product.id + `_${i}`}
133
136
  isSoldOut={product.inventoried && !product.quantity}
134
137
  product={product}
135
- enableIntersection={!isFiltMode && categoryState.products?.length < 80}
138
+ enableIntersection={!isFiltMode}
136
139
  businessId={businessId}
137
140
  categoryState={categoryState}
138
141
  onProductClick={onProductClick}
139
142
  handleUpdateProducts={handleUpdateProducts}
140
143
  productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
141
144
  navigation={navigation}
145
+ businessSingleId={businessSingleId}
142
146
  />
143
147
  ),
144
148
  )}
@@ -166,27 +170,31 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
166
170
  style={bpStyles.catWrap}
167
171
  onLayout={(event: any) => handleOnLayout(event, category.id)}
168
172
  >
169
- <View style={bpStyles.catIcon}>
170
- <OIcon
171
- url={optimizeImage(category.image, 'h_250,c_limit')}
172
- width={41}
173
- height={41}
174
- style={{ borderRadius: 7.6 }}
175
- />
176
- </View>
173
+ {!!category.image && (
174
+ <View style={bpStyles.catIcon}>
175
+ <OIcon
176
+ url={optimizeImage(category.image, 'h_250,c_limit')}
177
+ width={41}
178
+ height={41}
179
+ style={{ borderRadius: 7.6 }}
180
+ />
181
+ </View>
182
+ )}
177
183
  <OText size={16} weight="600">
178
184
  {category.name}
179
185
  </OText>
180
186
  {category?.ribbon?.enabled && (
181
187
  <RibbonBox
182
188
  bgColor={category?.ribbon?.color}
189
+ colorText={lightenDarkenColor(category?.ribbon?.color)}
190
+ borderRibbon={lightenDarkenColor(category?.ribbon?.color)}
183
191
  isRoundRect={category?.ribbon?.shape === shape?.rectangleRound}
184
192
  isCapsule={category?.ribbon?.shape === shape?.capsuleShape}
185
193
  >
186
194
  <OText
187
195
  size={10}
188
196
  weight={'400'}
189
- color={theme.colors.white}
197
+ color={lightenDarkenColor(category?.ribbon?.color) ? theme.colors.black : theme.colors.white}
190
198
  numberOfLines={2}
191
199
  ellipsizeMode='tail'
192
200
  lineHeight={13}
@@ -229,7 +237,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
229
237
  {products.sort((a: any, b: any) => a.rank - b.rank).map((product: any, i: any) => (
230
238
  <SingleProductCard
231
239
  key={`${product?.id}_${i}`}
232
- enableIntersection={!isFiltMode && categoryState.products?.length < 80}
240
+ enableIntersection={!isFiltMode}
233
241
  isSoldOut={product.inventoried && !product.quantity}
234
242
  businessId={businessId}
235
243
  product={product}
@@ -238,6 +246,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
238
246
  handleUpdateProducts={handleUpdateProducts}
239
247
  navigation={navigation}
240
248
  productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
249
+ businessSingleId={businessSingleId}
241
250
  />
242
251
  ))}
243
252
  </>
@@ -300,10 +309,11 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
300
309
  ? t('SEARCH_REDIRECT', 'Go to Businesses')
301
310
  : t('CLEAR_FILTERS', 'Clear filters')
302
311
  }
303
- onClickButton={() =>
312
+ onClickButton={!businessSingleId ? () =>
304
313
  !searchValue
305
314
  ? handleSearchRedirect && handleSearchRedirect()
306
315
  : handleCancelSearch && handleCancelSearch()
316
+ : null
307
317
  }
308
318
  />
309
319
  </WrapperNotFound>
@@ -18,18 +18,23 @@ 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
  `}
30
+
31
+ ${(props: any) => props.colorText && css`
32
+ color: ${props.colorText ? 'black' : 'white'};
33
+ `}
34
+
35
+ ${(props: any) => props.borderRibbon && css`
36
+ border: 1px solid ${props.borderRibbon ? 'black' : 'white'};
37
+ `}
33
38
  `
34
39
 
35
40
  export const SubCategoriesContainer = styled.View`
@@ -13,7 +13,7 @@ const UpsellingRedirectUI = (props: any) => {
13
13
  if (!upsellingProducts.loading) {
14
14
  if (upsellingProducts?.products?.length) {
15
15
  onRedirect &&
16
- onRedirect('UpsellingPage', props)
16
+ onRedirect('UpsellingPage', {...props, products: upsellingProducts?.products })
17
17
  } else {
18
18
  handleUpsellingPage && handleUpsellingPage()
19
19
  }