ordering-ui-react-native 0.17.45 → 0.17.46-release

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/package.json +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 +7 -1
  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/GoogleMap/index.tsx +58 -57
  19. package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
  20. package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
  21. package/themes/business/src/components/LoginForm/index.tsx +238 -80
  22. package/themes/business/src/components/LoginForm/styles.tsx +10 -0
  23. package/themes/business/src/components/MapView/index.tsx +10 -10
  24. package/themes/business/src/components/NewOrderNotification/index.tsx +49 -50
  25. package/themes/business/src/components/OrderDetails/Delivery.tsx +4 -3
  26. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +92 -49
  27. package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +59 -62
  28. package/themes/business/src/components/OrderDetailsLogistic/index.tsx +195 -0
  29. package/themes/business/src/components/OrderDetailsLogistic/styles.tsx +5 -0
  30. package/themes/business/src/components/OrderMessage/index.tsx +18 -17
  31. package/themes/business/src/components/OrderSummary/index.tsx +113 -121
  32. package/themes/business/src/components/OrdersOption/index.tsx +32 -75
  33. package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
  34. package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
  35. package/themes/business/src/components/PreviousOrders/index.tsx +445 -243
  36. package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
  37. package/themes/business/src/components/ProductItemAccordion/index.tsx +27 -3
  38. package/themes/business/src/components/ReviewCustomer/index.tsx +29 -14
  39. package/themes/business/src/components/StoresList/index.tsx +2 -2
  40. package/themes/business/src/components/shared/OLink.tsx +33 -13
  41. package/themes/business/src/components/shared/OModal.tsx +16 -9
  42. package/themes/business/src/components/shared/OText.tsx +8 -2
  43. package/themes/business/src/types/index.tsx +32 -2
  44. package/themes/business/src/utils/index.tsx +44 -1
  45. package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
  46. package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
  47. package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
  48. package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
  49. package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
  50. package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
  51. package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
  52. package/themes/kiosk/src/components/LoginForm/index.tsx +480 -156
  53. package/themes/kiosk/src/components/LoginForm/styles.tsx +14 -1
  54. package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
  55. package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
  56. package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
  57. package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +3 -2
  58. package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
  59. package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
  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 +6 -0
  66. package/themes/original/src/components/AddressDetails/index.tsx +29 -11
  67. package/themes/original/src/components/AddressForm/index.tsx +79 -44
  68. package/themes/original/src/components/AddressList/index.tsx +26 -21
  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 +160 -91
  74. package/themes/original/src/components/BusinessBasicInformation/styles.tsx +9 -7
  75. package/themes/original/src/components/BusinessController/index.tsx +141 -67
  76. package/themes/original/src/components/BusinessController/styles.tsx +22 -2
  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 +10 -31
  80. package/themes/original/src/components/BusinessItemAccordion/index.tsx +23 -22
  81. package/themes/original/src/components/BusinessListingSearch/index.tsx +352 -326
  82. package/themes/original/src/components/BusinessPreorder/index.tsx +97 -16
  83. package/themes/original/src/components/BusinessProductsList/index.tsx +20 -11
  84. package/themes/original/src/components/BusinessProductsList/styles.tsx +8 -3
  85. package/themes/original/src/components/BusinessProductsListing/UpsellingRedirect.tsx +1 -1
  86. package/themes/original/src/components/BusinessProductsListing/index.tsx +684 -526
  87. package/themes/original/src/components/BusinessProductsListing/styles.tsx +2 -2
  88. package/themes/original/src/components/BusinessReviews/index.tsx +3 -1
  89. package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +1 -1
  90. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +98 -79
  91. package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
  92. package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
  93. package/themes/original/src/components/Cart/index.tsx +100 -67
  94. package/themes/original/src/components/CartContent/index.tsx +115 -19
  95. package/themes/original/src/components/CartContent/styles.tsx +17 -7
  96. package/themes/original/src/components/Checkout/index.tsx +370 -174
  97. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  98. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  99. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  100. package/themes/original/src/components/CouponControl/index.tsx +10 -3
  101. package/themes/original/src/components/DriverTips/index.tsx +52 -34
  102. package/themes/original/src/components/FacebookLogin/styles.tsx +3 -1
  103. package/themes/original/src/components/Favorite/index.tsx +8 -9
  104. package/themes/original/src/components/Favorite/styles.tsx +1 -1
  105. package/themes/original/src/components/FavoriteList/index.tsx +51 -80
  106. package/themes/original/src/components/FloatingButton/index.tsx +1 -2
  107. package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
  108. package/themes/original/src/components/GPSButton/index.tsx +6 -4
  109. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  110. package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +96 -0
  111. package/themes/original/src/components/GiftCard/GiftCardUI/styles.tsx +5 -0
  112. package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +100 -0
  113. package/themes/original/src/components/GiftCard/PurchaseGiftCard/styles.tsx +8 -0
  114. package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +191 -0
  115. package/themes/original/src/components/GiftCard/RedeemGiftCard/styles.tsx +8 -0
  116. package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +165 -0
  117. package/themes/original/src/components/GiftCard/SendGiftCard/styles.tsx +9 -0
  118. package/themes/original/src/components/GoogleLogin/styles.tsx +1 -1
  119. package/themes/original/src/components/GoogleMap/index.tsx +15 -4
  120. package/themes/original/src/components/Help/index.tsx +8 -8
  121. package/themes/original/src/components/HelpAccountAndPayment/index.tsx +10 -31
  122. package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +5 -3
  123. package/themes/original/src/components/HelpGuide/index.tsx +6 -6
  124. package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
  125. package/themes/original/src/components/HelpOrder/index.tsx +6 -15
  126. package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
  127. package/themes/original/src/components/Home/index.tsx +13 -4
  128. package/themes/original/src/components/LastOrder/index.tsx +1 -34
  129. package/themes/original/src/components/LoginForm/Otp/index.tsx +139 -75
  130. package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
  131. package/themes/original/src/components/LoginForm/index.tsx +63 -26
  132. package/themes/original/src/components/LottieAnimation/index.tsx +89 -55
  133. package/themes/original/src/components/MessageListing/index.tsx +16 -42
  134. package/themes/original/src/components/Messages/index.tsx +32 -10
  135. package/themes/original/src/components/MomentOption/index.tsx +195 -88
  136. package/themes/original/src/components/MultiCart/index.tsx +50 -0
  137. package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +151 -49
  138. package/themes/original/src/components/MultiCheckout/index.tsx +308 -88
  139. package/themes/original/src/components/MultiCheckout/styles.tsx +3 -1
  140. package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
  141. package/themes/original/src/components/MultiOrdersDetails/index.tsx +68 -21
  142. package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
  143. package/themes/original/src/components/MyOrders/index.tsx +53 -51
  144. package/themes/original/src/components/NavBar/index.tsx +18 -18
  145. package/themes/original/src/components/NotFoundSource/index.tsx +14 -10
  146. package/themes/original/src/components/Notifications/index.tsx +46 -50
  147. package/themes/original/src/components/Notifications/styles.tsx +6 -3
  148. package/themes/original/src/components/OrderDetails/OrderEta.tsx +76 -0
  149. package/themes/original/src/components/OrderDetails/OrderHistory.tsx +15 -3
  150. package/themes/original/src/components/OrderDetails/index.tsx +191 -359
  151. package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
  152. package/themes/original/src/components/OrderItAgain/index.tsx +3 -1
  153. package/themes/original/src/components/OrderProgress/index.tsx +93 -114
  154. package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
  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 +70 -65
  160. package/themes/original/src/components/OrdersOption/styles.tsx +1 -1
  161. package/themes/original/src/components/PageBanner/index.tsx +171 -0
  162. package/themes/original/src/components/PageBanner/styles.tsx +11 -0
  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 +116 -37
  170. package/themes/original/src/components/ProductForm/styles.tsx +5 -7
  171. package/themes/original/src/components/ProductItemAccordion/index.tsx +14 -13
  172. package/themes/original/src/components/ProductOptionSubOption/index.tsx +19 -11
  173. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
  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 +74 -19
  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 +42 -19
  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 +72 -34
  194. package/themes/original/src/components/SingleProductCard/styles.tsx +22 -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 +51 -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 +47 -7
  202. package/themes/original/src/components/UserProfile/index.tsx +5 -7
  203. package/themes/original/src/components/UserProfileForm/index.tsx +25 -28
  204. package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
  205. package/themes/original/src/components/WalletTransactionItem/index.tsx +2 -2
  206. package/themes/original/src/components/WalletTransactions/index.tsx +3 -3
  207. package/themes/original/src/components/Wallets/index.tsx +67 -24
  208. package/themes/original/src/components/Wallets/styles.tsx +5 -4
  209. package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
  210. package/themes/original/src/components/shared/OButton.tsx +6 -2
  211. package/themes/original/src/components/shared/OInput.tsx +16 -2
  212. package/themes/original/src/components/shared/OModal.tsx +3 -3
  213. package/themes/original/src/layouts/Container.tsx +1 -1
  214. package/themes/original/src/types/index.tsx +38 -9
  215. package/themes/original/src/utils/index.tsx +364 -58
  216. package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { TouchableOpacity, StyleSheet, View, Dimensions, Platform } from 'react-native'
3
3
  import { useLanguage, useUtils, useConfig, useOrder, MomentOption } from 'ordering-components/native'
4
- import { OButton, OText } from '../shared'
4
+ import { OButton, OIcon, OText } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
6
  import IconAntDesign from 'react-native-vector-icons/AntDesign'
7
7
  import FastImage from 'react-native-fast-image'
@@ -37,7 +37,10 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
37
37
  handleChangeDate,
38
38
  handleChangeTime,
39
39
  handleAsap,
40
- isAsap
40
+ getActualSchedule,
41
+ isAsap,
42
+ cateringPreorder,
43
+ preorderLeadTime
41
44
  } = props
42
45
 
43
46
  const theme = useTheme()
@@ -52,6 +55,8 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
52
55
  const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
53
56
  const [isEnabled, setIsEnabled] = useState(false)
54
57
  const { top } = useSafeAreaInsets()
58
+ const is12hours = configs?.dates_moment_format?.value?.includes('hh:mm')
59
+
55
60
  const showOrderTime = (selectedPreorderType === 1 && Object.keys(menu)?.length > 0) || selectedPreorderType === 0
56
61
  const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
57
62
  const styles = StyleSheet.create({
@@ -165,7 +170,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
165
170
  if (date.getDate() !== dateSeleted.getDate() || i >= date.getHours()) {
166
171
  let hour = ''
167
172
  let meridian = ''
168
- if (configs?.format_time?.value === '12') {
173
+ if (is12hours) {
169
174
  if (i === 0) {
170
175
  hour = '12'
171
176
  meridian = ' ' + t('AM', 'AM')
@@ -252,10 +257,45 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
252
257
 
253
258
  useEffect(() => {
254
259
  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])
260
+ if (cateringPreorder) {
261
+ let _timeLists = []
262
+ const schedule = business && getActualSchedule()
263
+ if (!schedule && cateringPreorder && Object.keys(business)?.length > 0) {
264
+ return
265
+ }
266
+ _timeLists = hoursList
267
+ .filter(hour => ((Object.keys(business || {})?.length === 0) || schedule?.lapses?.some((lapse: any) =>
268
+ 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}`))) &&
269
+ moment(dateSelected + ` ${hour.startTime}`) < moment(dateSelected + ` ${hour.endTime}`) &&
270
+ (moment().add(preorderLeadTime, 'minutes') < moment(dateSelected + ` ${hour.startTime}`) || !cateringPreorder))
271
+ .map(hour => {
272
+ return {
273
+ value: hour.startTime,
274
+ text: is12hours ? (
275
+ hour.startTime.includes('12')
276
+ ? `${hour.startTime}PM`
277
+ : parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
278
+ ) : (
279
+ parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'HH:mm' })
280
+ ),
281
+ endText: is12hours ? (
282
+ hour.endTime.includes('12')
283
+ ? `${hour.endTime}PM`
284
+ : parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'hh:mma' })
285
+ ) : (
286
+ parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'HH:mm' })
287
+ )
288
+ }
289
+ })
290
+ if (_timeLists?.length > 0) {
291
+ setTimeList(_timeLists)
292
+ }
293
+ } else {
294
+ const selectedMenu = Object.keys(menu).length > 0 ? (menu?.use_business_schedule ? business : menu) : business
295
+ const _times = getTimes(selectDate, selectedMenu)
296
+ setTimeList(_times)
297
+ }
298
+ }, [selectDate, menu, business, cateringPreorder, hoursList, dateSelected])
259
299
 
260
300
  useEffect(() => {
261
301
  if (selectedPreorderType === 0 && Object.keys(menu).length > 0) setMenu({})
@@ -263,6 +303,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
263
303
 
264
304
  useEffect(() => {
265
305
  if (dateSelected) {
306
+
266
307
  const dateParts = dateSelected.split('-')
267
308
  const _dateSelected = new Date(dateParts[0], dateParts[1] - 1, dateParts[2])
268
309
  setSelectedDate(_dateSelected)
@@ -302,7 +343,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
302
343
  />
303
344
  </View>
304
345
  </BusinessInfoWrapper>
305
- {isPreOrderSetting && (
346
+ {isPreOrderSetting && !cateringPreorder && (
306
347
  <PreorderTypeWrapper>
307
348
  <OText
308
349
  size={16}
@@ -415,19 +456,36 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
415
456
  />
416
457
  )}
417
458
  </View>
418
- <TimeListWrapper nestedScrollEnabled={true}>
419
- {(isEnabled && timeList?.length > 0) ? (
459
+ <TimeListWrapper nestedScrollEnabled={true} cateringPreorder={cateringPreorder}>
460
+ {((isEnabled || cateringPreorder) && timeList?.length > 0) ? (
420
461
  <TimeContentWrapper>
421
462
  {timeList.map((time: any, i: number) => (
422
463
  <TouchableOpacity key={i} onPress={() => handleChangeTime(time.value)}>
423
- <TimeItem active={timeSelected === time.value}>
464
+ <TimeItem active={timeSelected === time.value} cateringPreorder={cateringPreorder}>
465
+ {cateringPreorder && (
466
+ <>
467
+ {timeSelected === time.value ? (
468
+ <OIcon
469
+ src={theme.images.general.option_checked}
470
+ width={18}
471
+ style={{ marginEnd: 24, bottom: 2 }}
472
+ />
473
+ ) : (
474
+ <OIcon
475
+ src={theme.images.general.option_normal}
476
+ width={18}
477
+ style={{ marginEnd: 24, bottom: 2 }}
478
+ />
479
+ )}
480
+ </>
481
+ )}
424
482
  <OText
425
- size={14}
483
+ size={cateringPreorder ? 18 : 16}
426
484
  color={timeSelected === time.value ? theme.colors.primary : theme.colors.textNormal}
427
485
  style={{
428
486
  lineHeight: 24
429
487
  }}
430
- >{time.text}</OText>
488
+ >{time.text} {cateringPreorder && `- ${time.endText}`}</OText>
431
489
  </TimeItem>
432
490
  </TouchableOpacity>
433
491
  ))}
@@ -461,7 +519,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
461
519
  marginBottom: 12,
462
520
  textAlign: 'center'
463
521
  }}
464
- >
522
+ >
465
523
  {t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
466
524
  </OText>
467
525
  )}
@@ -480,7 +538,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
480
538
 
481
539
  export const BusinessPreorder = (props: any) => {
482
540
  const [{ configs }] = useConfig()
483
-
541
+ const [orderState] = useOrder()
484
542
  const limitDays = parseInt(configs?.max_days_preorder?.value, 10)
485
543
 
486
544
  const currentDate = new Date()
@@ -492,10 +550,33 @@ export const BusinessPreorder = (props: any) => {
492
550
  currentDate.setHours(23)
493
551
  currentDate.setMinutes(59)
494
552
 
553
+ const cateringTypeString = orderState?.options?.type === 7
554
+ ? 'catering_delivery'
555
+ : orderState?.options?.type === 8
556
+ ? 'catering_pickup'
557
+ : null
558
+
559
+ const splitCateringValue = (configName : string) =>
560
+ Object.values(props?.business?.configs || {})
561
+ ?.find(config => config?.key === configName)
562
+ ?.value?.split('|')
563
+ ?.find(val => val.includes(cateringTypeString || ''))?.split(',')[1]
564
+ const preorderSlotInterval = parseInt(splitCateringValue('preorder_slot_interval'))
565
+ const preorderLeadTime = parseInt(splitCateringValue('preorder_lead_time'))
566
+ const preorderTimeRange = parseInt(splitCateringValue('preorder_time_range'))
567
+ const preorderMaximumDays = parseInt(splitCateringValue('preorder_maximum_days'))
568
+ const preorderMinimumDays = parseInt(splitCateringValue('preorder_minimum_days'))
569
+
495
570
  const businessPreorderProps = {
496
571
  ...props,
497
572
  UIComponent: BusinessPreorderUI,
498
- maxDate: currentDate
573
+ maxDate: currentDate,
574
+ preorderLeadTime,
575
+ preorderSlotInterval,
576
+ preorderTimeRange,
577
+ preorderMaximumDays,
578
+ preorderMinimumDays,
579
+ cateringPreorder: !!cateringTypeString
499
580
  }
500
581
  return <MomentOption {...businessPreorderProps} />
501
582
  }
@@ -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 &&
@@ -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
  }
@@ -139,6 +142,7 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
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}
@@ -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
  </>
@@ -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
  }