ordering-ui-external 10.1.0 → 10.2.0

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 (129) hide show
  1. package/_bundles/{0.ordering-ui.e9827c5566d8cce0eaa4.js → 0.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  2. package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  3. package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  4. package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  5. package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  6. package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  7. package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.8384f3801abcc340af2a.js} +2 -2
  8. package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  9. package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.8384f3801abcc340af2a.js} +1 -1
  10. package/_bundles/ordering-ui.8384f3801abcc340af2a.js +2 -0
  11. package/_modules/components/BusinessBasicInformation/index.js +7 -10
  12. package/_modules/components/OrderDetails/index.js +14 -17
  13. package/_modules/components/ProductItemAccordion/index.js +4 -5
  14. package/_modules/components/RenderProductsLayout/SearchProducts/index.js +2 -5
  15. package/_modules/components/UserFormDetails/index.js +7 -8
  16. package/_modules/components/UserProfileForm/ProfileOptions/index.js +4 -5
  17. package/_modules/components/UserProfileForm/index.js +10 -11
  18. package/_modules/contexts/ThemeContext/index.js +1 -1
  19. package/_modules/themes/five/src/components/AddressList/index.js +0 -3
  20. package/_modules/themes/five/src/components/BusinessController/index.js +11 -14
  21. package/_modules/themes/five/src/components/BusinessInformation/styles.js +19 -14
  22. package/_modules/themes/five/src/components/BusinessPreorder/index.js +51 -10
  23. package/_modules/themes/five/src/components/BusinessPreorder/styles.js +32 -25
  24. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -5
  25. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -4
  26. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +11 -12
  27. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -10
  28. package/_modules/themes/five/src/components/Cart/index.js +17 -9
  29. package/_modules/themes/five/src/components/CartPopover/index.js +4 -7
  30. package/_modules/themes/five/src/components/CartPopover/styles.js +4 -1
  31. package/_modules/themes/five/src/components/Checkout/index.js +3 -6
  32. package/_modules/themes/five/src/components/Confirm/styles.js +16 -13
  33. package/_modules/themes/five/src/components/DatePicker/index.js +2 -1
  34. package/_modules/themes/five/src/components/Favorite/index.js +4 -5
  35. package/_modules/themes/five/src/components/Footer/index.js +2 -3
  36. package/_modules/themes/five/src/components/Header/index.js +5 -8
  37. package/_modules/themes/five/src/components/HeaderOption/index.js +4 -5
  38. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -10
  39. package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
  40. package/_modules/themes/five/src/components/Modal/styles.js +4 -2
  41. package/_modules/themes/five/src/components/MomentContent/index.js +16 -6
  42. package/_modules/themes/five/src/components/MomentControl/index.js +44 -34
  43. package/_modules/themes/five/src/components/MomentControl/styles.js +49 -27
  44. package/_modules/themes/five/src/components/OrderDetails/index.js +31 -24
  45. package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -7
  46. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +11 -1
  47. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
  48. package/_modules/themes/five/src/components/PageBanner/index.js +75 -54
  49. package/_modules/themes/five/src/components/ProductForm/styles.js +12 -9
  50. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +0 -3
  51. package/_modules/themes/five/src/components/ProductOption/styles.js +4 -1
  52. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +8 -9
  53. package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +0 -3
  54. package/_modules/themes/five/src/components/UserFormDetails/index.js +3 -6
  55. package/_modules/themes/five/src/components/UserPopover/index.js +3 -6
  56. package/_modules/themes/five/src/components/UserPopover/styles.js +8 -5
  57. package/_modules/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -5
  58. package/_modules/themes/five/src/components/UserProfileForm/index.js +2 -5
  59. package/_modules/themes/six/src/components/BusinessBasicInformation/index.js +8 -9
  60. package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -6
  61. package/package.json +2 -2
  62. package/src/components/BusinessBasicInformation/index.js +7 -8
  63. package/src/components/OrderDetails/index.js +14 -16
  64. package/src/components/ProductItemAccordion/index.js +4 -3
  65. package/src/components/RenderProductsLayout/SearchProducts/index.js +2 -3
  66. package/src/components/UserFormDetails/index.js +6 -5
  67. package/src/components/UserProfileForm/ProfileOptions/index.js +4 -4
  68. package/src/components/UserProfileForm/index.js +10 -10
  69. package/src/contexts/ThemeContext/index.js +1 -1
  70. package/src/themes/five/src/components/AddressForm/index.js +1 -2
  71. package/src/themes/five/src/components/AddressList/index.js +1 -3
  72. package/src/themes/five/src/components/BusinessController/index.js +2 -4
  73. package/src/themes/five/src/components/BusinessInformation/index.js +1 -2
  74. package/src/themes/five/src/components/BusinessInformation/styles.js +2 -2
  75. package/src/themes/five/src/components/BusinessPreorder/index.js +61 -10
  76. package/src/themes/five/src/components/BusinessPreorder/styles.js +93 -43
  77. package/src/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
  78. package/src/themes/five/src/components/BusinessProductsList/index.js +1 -2
  79. package/src/themes/five/src/components/BusinessProductsListing/index.js +10 -3
  80. package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
  81. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -7
  82. package/src/themes/five/src/components/Cart/index.js +11 -4
  83. package/src/themes/five/src/components/CartPopover/index.js +2 -3
  84. package/src/themes/five/src/components/CartPopover/styles.js +1 -1
  85. package/src/themes/five/src/components/Checkout/index.js +2 -4
  86. package/src/themes/five/src/components/Confirm/styles.js +1 -1
  87. package/src/themes/five/src/components/DatePicker/index.js +1 -0
  88. package/src/themes/five/src/components/Favorite/index.js +4 -3
  89. package/src/themes/five/src/components/Footer/index.js +3 -2
  90. package/src/themes/five/src/components/Header/index.js +4 -5
  91. package/src/themes/five/src/components/HeaderOption/index.js +4 -3
  92. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -8
  93. package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -0
  94. package/src/themes/five/src/components/Modal/styles.js +1 -1
  95. package/src/themes/five/src/components/MomentContent/index.js +17 -8
  96. package/src/themes/five/src/components/MomentControl/index.js +83 -45
  97. package/src/themes/five/src/components/MomentControl/styles.js +137 -34
  98. package/src/themes/five/src/components/MyOrders/index.js +1 -1
  99. package/src/themes/five/src/components/OrderDetails/index.js +50 -21
  100. package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -6
  101. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +13 -1
  102. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
  103. package/src/themes/five/src/components/PageBanner/index.js +64 -50
  104. package/src/themes/five/src/components/ProductForm/styles.js +1 -1
  105. package/src/themes/five/src/components/ProductItemAccordion/index.js +1 -2
  106. package/src/themes/five/src/components/ProductOption/styles.js +1 -1
  107. package/src/themes/five/src/components/RenderProductsLayout/index.js +9 -6
  108. package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +1 -2
  109. package/src/themes/five/src/components/UserFormDetails/index.js +3 -4
  110. package/src/themes/five/src/components/UserPopover/index.js +3 -4
  111. package/src/themes/five/src/components/UserPopover/styles.js +1 -1
  112. package/src/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -3
  113. package/src/themes/five/src/components/UserProfileForm/index.js +2 -4
  114. package/src/themes/six/src/components/BusinessBasicInformation/index.js +8 -7
  115. package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +2 -3
  116. package/template/app.js +15 -10
  117. package/template/components/HelmetTags/index.js +3 -2
  118. package/template/pages/AddressList/index.js +4 -3
  119. package/template/pages/BusinessProductsList/index.js +5 -4
  120. package/template/pages/BusinessesList/index.js +6 -6
  121. package/template/pages/Checkout/index.js +6 -4
  122. package/template/pages/Home/index.js +4 -2
  123. package/template/pages/MessagesList/index.js +5 -4
  124. package/template/pages/MyOrders/index.js +6 -5
  125. package/template/pages/OrderDetails/index.js +4 -3
  126. package/_bundles/ordering-ui.e9827c5566d8cce0eaa4.js +0 -2
  127. package/template/components/OrderingThemeUpdated/index.js +0 -41
  128. /package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → 7.ordering-ui.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
  129. /package/_bundles/{ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → ordering-ui.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
@@ -26,7 +26,8 @@ import {
26
26
  DayName,
27
27
  DayNumber,
28
28
  TimeItem,
29
- ClosedBusinessMsg
29
+ ClosedBusinessMsg,
30
+ CheckIcon
30
31
  } from './styles'
31
32
  import CgRadioCheck from '@meronex/icons/cg/CgRadioCheck'
32
33
  import { Button } from '../../styles/Buttons'
@@ -51,7 +52,14 @@ const MomentControlUI = (props) => {
51
52
  handleChangeDate,
52
53
  handleChangeTime,
53
54
  onClose,
54
- isAppoint
55
+ isAppoint,
56
+ cateringPreorder,
57
+ isCart,
58
+ preorderLeadTime,
59
+ business,
60
+ getActualSchedule,
61
+ preorderMaximumDays,
62
+ preorderMinimumDays
55
63
  } = props
56
64
 
57
65
  const [{ configs }] = useConfig()
@@ -150,32 +158,49 @@ const MomentControlUI = (props) => {
150
158
 
151
159
  useEffect(() => {
152
160
  let _timeLists = []
153
- if (!scheduleList) {
154
- _timeLists = hoursList.map(hour => {
155
- return {
156
- value: hour.startTime,
157
- text: is12hours ? (
158
- hour.startTime.includes('12')
159
- ? `${hour.startTime}PM`
160
- : parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
161
- ) : (
162
- parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'HH:mm' })
163
- )
164
- }
165
- })
161
+ if (!scheduleList || cateringPreorder) {
162
+ const schedule = business && Object.keys(business || {})?.length > 0 && getActualSchedule()
163
+ if (!schedule && cateringPreorder && Object.keys(business)?.length > 0) {
164
+ setIsEnabled(false)
165
+ return
166
+ }
167
+ _timeLists = hoursList
168
+ .filter(hour => (Object.keys(business || {})?.length === 0 || schedule?.lapses?.some(lapse =>
169
+ 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}`))) &&
170
+ moment(dateSelected + ` ${hour.startTime}`) < moment(dateSelected + ` ${hour.endTime}`) &&
171
+ (moment().add(preorderLeadTime, 'minutes') < moment(dateSelected + ` ${hour.startTime}`) || !cateringPreorder))
172
+ .map(hour => {
173
+ return {
174
+ value: hour.startTime,
175
+ text: is12hours ? (
176
+ hour.startTime.includes('12')
177
+ ? `${hour.startTime}PM`
178
+ : parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
179
+ ) : (
180
+ parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'HH:mm' })
181
+ ),
182
+ endText: is12hours ? (
183
+ hour.endTime.includes('12')
184
+ ? `${hour.endTime}PM`
185
+ : parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'hh:mma' })
186
+ ) : (
187
+ parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'HH:mm' })
188
+ )
189
+ }
190
+ })
166
191
  setIsEnabled(true)
167
192
  } else {
168
193
  _timeLists = getTimes(dateSelected, scheduleList)
169
194
  }
170
195
  setTimeList(_timeLists)
171
- }, [dateSelected, hoursList, scheduleList])
196
+ }, [dateSelected, hoursList, scheduleList, cateringPreorder, JSON.stringify(business)])
172
197
 
173
198
  useEffect(() => {
174
- handleCheckBoxChange(isAsap)
199
+ handleCheckBoxChange(isAsap && ((preorderMinimumDays === 0 && preorderLeadTime === 0) || !cateringPreorder))
175
200
  }, [isAsap])
176
201
 
177
202
  useEffect(() => {
178
- if (!pathname.includes('store')) {
203
+ if (!pathname.includes('store') || isCart) {
179
204
  setScheduleList(null)
180
205
  return
181
206
  }
@@ -190,23 +215,21 @@ const MomentControlUI = (props) => {
190
215
 
191
216
  return (
192
217
  <div id='moment_control'>
193
- {props.beforeElements?.map((BeforeElement, i) => (
194
- <React.Fragment key={i}>
195
- {BeforeElement}
196
- </React.Fragment>))}
197
- {props.beforeComponents?.map((BeforeComponent, i) => (
198
- <BeforeComponent key={i} {...props} />))}
199
218
  {!isAppoint && (
200
219
  <>
201
- <Title>{t('WHEN_DO_WE_DELIVERY', 'When do we delivery?')}</Title>
202
- <CheckBoxWrapper
203
- highlight={isAsap && isASP}
204
- onClick={() => handleCheckBoxChange(true)}
205
- isLoading={orderState?.loading}
206
- >
207
- {isASP ? <CheckedIcon /> : <CgRadioCheck />}
208
- <span>{t('CHECKOUT_ASAP', 'ASAP')} ({moment(new Date()).format('LLLL')} - {t('DELIVERY_TIME', 'delivery time')})</span>
209
- </CheckBoxWrapper>
220
+ {!isCart && (
221
+ <Title>{t('WHEN_DO_WE_DELIVERY', 'When do we delivery?')}</Title>
222
+ )}
223
+ {((preorderMinimumDays === 0 && preorderLeadTime === 0) || !cateringPreorder) && (
224
+ <CheckBoxWrapper
225
+ highlight={isAsap && isASP}
226
+ onClick={() => handleCheckBoxChange(true)}
227
+ isLoading={orderState?.loading}
228
+ >
229
+ {isASP ? <CheckedIcon /> : <CgRadioCheck />}
230
+ <span>{t('CHECKOUT_ASAP', 'ASAP')} ({moment(new Date()).format('LLLL')} - {t('DELIVERY_TIME', 'delivery time')})</span>
231
+ </CheckBoxWrapper>
232
+ )}
210
233
  <CheckBoxWrapper
211
234
  highlight={!isASP}
212
235
  onClick={() => handleCheckBoxChange(null)}
@@ -220,10 +243,16 @@ const MomentControlUI = (props) => {
220
243
  (!isASP || isAppoint) && (
221
244
  !props.isCustomLayout ? (
222
245
  <OrderTimeWrapper>
223
- {!isAppoint && <p>{t('ORDER_TIME', 'Order time')}</p>}
246
+ {!isAppoint && !isCart && <p>{t('ORDER_TIME', 'Order time')}</p>}
224
247
  <DateWrapper>
225
248
  <MonthYearLayer>
226
- <span>{moment(dateSelected).format('MMMM, yyyy')}</span>
249
+ <span>
250
+ {
251
+ datesList.slice((cateringPreorder && preorderMinimumDays) || 0, Number(cateringPreorder ? preorderMaximumDays : configs?.max_days_preorder?.value ?? 6, 10))?.length === 0
252
+ ? moment(dateSelected).format('Do MMMM, yyyy')
253
+ : moment(dateSelected).format('MMMM, yyyy')
254
+ }
255
+ </span>
227
256
  </MonthYearLayer>
228
257
  <DaysSwiper left={<BsCaretLeftFill />}>
229
258
  <Swiper
@@ -253,7 +282,7 @@ const MomentControlUI = (props) => {
253
282
  preventClicksPropagation={false}
254
283
  >
255
284
  {
256
- datesList.slice(0, Number(configs?.max_days_preorder?.value || 6, 10)).map(date => {
285
+ datesList.slice((cateringPreorder && preorderMinimumDays) || 0, Number(cateringPreorder ? preorderMaximumDays : configs?.max_days_preorder?.value ?? 6, 10)).map(date => {
257
286
  const dateParts = date.split('-')
258
287
  const _date = new Date(dateParts[0], dateParts[1] - 1, dateParts[2])
259
288
  const dayName = t('DAY' + (_date.getDay() >= 1 ? _date.getDay() : 7)).substring(0, 2)
@@ -280,13 +309,27 @@ const MomentControlUI = (props) => {
280
309
  active={timeSelected === time.value}
281
310
  onClick={() => handleChangeTime(time.value)}
282
311
  isAppoint={isAppoint}
312
+ cateringPreorder={cateringPreorder}
283
313
  >
284
- <span>{time.text}</span>
314
+ <span>
315
+ {cateringPreorder && (
316
+ <CheckIcon>
317
+ {timeSelected === time.value ? <CheckedIcon cateringPreorder={cateringPreorder} /> : <CgRadioCheck />}
318
+ </CheckIcon>
319
+ )}
320
+ <p>
321
+ {time.text} {cateringPreorder && `- ${time.endText}`}
322
+ </p>
323
+ </span>
285
324
  </TimeItem>
286
325
  ))}
287
326
  </>
288
327
  ) : (
289
- <ClosedBusinessMsg>{t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}</ClosedBusinessMsg>
328
+ <ClosedBusinessMsg>
329
+ {!business
330
+ ? t('ERROR_SHEDULE_UNAVAILABLE', 'There are no schedules for this date')
331
+ : t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')}
332
+ </ClosedBusinessMsg>
290
333
  )}
291
334
  </TimeListWrapper>
292
335
  </OrderTimeWrapper>
@@ -303,23 +346,18 @@ const MomentControlUI = (props) => {
303
346
  )
304
347
  )
305
348
  }
306
- {!isAppoint && (
349
+ {!isAppoint && !isCart && (
307
350
  <ButtonWrapper>
308
351
  <Button
309
352
  color='primary'
310
353
  onClick={() => onClose()}
354
+ disabled={!timeSelected}
311
355
  >
312
356
  <span>{t('CONTINUE', 'Continue')}</span>
313
357
  <ArrowRight />
314
358
  </Button>
315
359
  </ButtonWrapper>
316
360
  )}
317
- {props.afterComponents?.map((AfterComponent, i) => (
318
- <AfterComponent key={i} {...props} />))}
319
- {props.afterElements?.map((AfterElement, i) => (
320
- <React.Fragment key={i}>
321
- {AfterElement}
322
- </React.Fragment>))}
323
361
  </div>
324
362
  )
325
363
  }
@@ -64,6 +64,9 @@ export const TimeListWrapper = styled.div`
64
64
  margin-top: 30px;
65
65
  max-height: 250px;
66
66
  overflow: auto;
67
+ ${({ cateringPreorder }) => cateringPreorder && css`
68
+ margin-left: 0;
69
+ `}
67
70
  `
68
71
 
69
72
  export const CheckedIcon = styled.div`
@@ -77,6 +80,13 @@ export const CheckedIcon = styled.div`
77
80
  ${props => props.theme.rtl && css`
78
81
  margin: 2px 2px 2px 12px;
79
82
  `}
83
+ ${({ cateringPreorder }) => cateringPreorder && css`
84
+ width: 21px;
85
+ min-width: 21px;
86
+ height: 21px;
87
+ margin: 0;
88
+ margin-left: 1px;
89
+ `}
80
90
  `
81
91
  export const ButtonWrapper = styled.div`
82
92
  margin-top: 25px;
@@ -155,6 +165,10 @@ export const DaysSwiper = styled.div`
155
165
  left: 0px;
156
166
  right: auto;
157
167
  }
168
+ .swiper-wrapper {
169
+ display: flex;
170
+ justify-content: space-between;
171
+ }
158
172
  }
159
173
  `
160
174
 
@@ -208,47 +222,75 @@ export const DayNumber = styled.div`
208
222
  export const TimeItem = styled.div`
209
223
  cursor: pointer;
210
224
  display: flex;
211
- justify-content: center;
212
- align-items: center;
213
- background: #E9ECEF;
214
- border-radius: 7.6px;
215
- padding: 5px 15px;
216
- margin: 12px;
217
- width: calc(50% - 24px);
218
- min-width: calc(50% - 24px);
219
- box-sizing: border-box;
220
- user-select: none;
221
-
222
- ${({ active }) => active && css`
223
- background: #F5F9FF;
224
- color: ${props => props.theme.colors.primary};
225
- `}
226
-
227
225
  span {
228
226
  font-size: 14px;
229
227
  white-space: nowrap;
230
228
  }
231
-
232
- @media (min-width: 400px) {
233
- width: calc(33.33% - 24px);
234
- min-width: calc(33.33% - 24px);
235
- }
236
-
237
- @media (min-width: 576px) {
238
- width: calc(25% - 24px);
239
- min-width: calc(25% - 24px);
240
- }
241
-
242
- @media (min-width: 769px) {
243
- width: calc(16.66% - 24px);
244
- min-width: calc(16.66% - 24px);
245
- ${({ isAppoint }) => isAppoint && css`
246
- width: calc(33.33% - 24px);
247
- min-width: calc(33.33% - 24px);
229
+ ${({ active }) => active && css`
230
+ background: #F5F9FF;
231
+ color: ${props => props.theme.colors.primary};
232
+ `}
233
+ ${({ cateringPreorder }) => cateringPreorder ? css`
234
+ background: #fff;
235
+ width: 100%;
236
+ min-width: 100%;
237
+ height: 50px;
238
+
239
+ span {
240
+ font-size: 18px;
241
+ display: flex;
242
+ align-items: center;
243
+ margin: 10px 0;
244
+ margin-left: 15px;
245
+ p{
246
+ position: relative;
247
+ bottom: 2px;
248
+ }
249
+ }
250
+ ${({ active }) => active && css`
251
+ background: #F5F9FF;
252
+ color: ${props => props.theme.colors.primary};
248
253
  span {
249
- font-size: 12px;
254
+ p{
255
+ bottom: 0;
256
+ margin-left: 2px;
257
+ }
250
258
  }
251
259
  `}
260
+ ` : css`
261
+ justify-content: center;
262
+ align-items: center;
263
+ background: #E9ECEF;
264
+ border-radius: 7.6px;
265
+ padding: 5px 15px;
266
+ margin: 12px;
267
+ width: calc(50% - 24px);
268
+ min-width: calc(50% - 24px);
269
+ box-sizing: border-box;
270
+ user-select: none;
271
+
272
+ @media (min-width: 400px) {
273
+ width: calc(33.33% - 24px);
274
+ min-width: calc(33.33% - 24px);
275
+ }
276
+
277
+ @media (min-width: 576px) {
278
+ width: calc(25% - 24px);
279
+ min-width: calc(25% - 24px);
280
+ }
281
+
282
+ @media (min-width: 769px) {
283
+ width: calc(33.33% - 24px);
284
+ min-width: calc(33.33% - 24px);
285
+ ${({ isAppoint }) => isAppoint && css`
286
+ width: calc(33.33% - 24px);
287
+ min-width: calc(33.33% - 24px);
288
+ span {
289
+ font-size: 12px;
290
+ }
291
+ `}
292
+ }
293
+ `
252
294
  }
253
295
  `
254
296
 
@@ -257,3 +299,64 @@ export const ClosedBusinessMsg = styled.div`
257
299
  font-size: 16px;
258
300
  width: 100%;
259
301
  `
302
+
303
+ export const SelectContainer = styled.div`
304
+ #list {
305
+ width: 100%;
306
+ }
307
+
308
+ > div {
309
+ width: 100%;
310
+ background-color: #F8F9FA!important;
311
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
312
+ min-height: 44px;
313
+ border: none;
314
+ border-radius: 7.6px;
315
+ color: #909BA9 !important;
316
+
317
+ > div:first-child {
318
+ padding-top: 5px;
319
+ padding-bottom: 5px;
320
+ justify-content: space-between;
321
+ }
322
+ > div#list {
323
+ width: 100%;
324
+ background-color: #F8F9FA!important;
325
+ border: 1px solid #F8F9FA;
326
+ border-radius: 7.6px;
327
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
328
+ }
329
+ }
330
+
331
+ ${({ theme }) => theme?.layouts?.checkout?.components?.layout?.type === 'pfchangs' && css`
332
+ background: #000;
333
+ #select-input {
334
+ margin-bottom: 0px;
335
+ }
336
+ div {
337
+ white-space: pre-wrap;
338
+ }
339
+ > div {
340
+ background-color: #000!important;
341
+ border: 1px solid #fff;
342
+ border-radius: 0px;
343
+ color: #fff !important;
344
+ padding: 0px 10px;
345
+ box-sizing: border-box;
346
+ height: auto;
347
+ > div#list {
348
+ background-color: #000 !important;
349
+ border: 1px solid #fff;
350
+ border-radius: 0px;
351
+ }
352
+ }
353
+ `}
354
+ `
355
+
356
+ export const CheckIcon = styled.div`
357
+ margin-right: 20px;
358
+ svg {
359
+ width: 24px;
360
+ height: 24px;
361
+ }
362
+ `
@@ -39,7 +39,7 @@ export const MyOrders = (props) => {
39
39
  const hideBusinessTab = theme?.orders?.components?.business_tab?.hidden
40
40
 
41
41
  const MyOrdersMenu = [
42
- { key: 'orders', value: t('ORDERS', 'Orders'), disabled: false},
42
+ { key: 'orders', value: t('ORDERS', 'Orders'), disabled: false },
43
43
  { key: 'business', value: t('BUSINESS', 'Business'), disabled: hideBusinessTab },
44
44
  { key: 'products', value: t('PRODUCTS', 'Products'), disabled: hideProductsTab }
45
45
  ]
@@ -8,8 +8,8 @@ import {
8
8
  useConfig,
9
9
  useOrder,
10
10
  useCustomer,
11
- GoogleMapsMap,
12
- useOrderingTheme
11
+ useSession,
12
+ GoogleMapsMap
13
13
  } from 'ordering-components-external'
14
14
  import RiUser2Fill from '@meronex/icons/ri/RiUser2Fill'
15
15
  import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
@@ -103,11 +103,11 @@ const OrderDetailsUI = (props) => {
103
103
  const [, t] = useLanguage()
104
104
  const [{ configs }] = useConfig()
105
105
  const theme = useTheme()
106
+ const [{ token }] = useSession()
106
107
  const [events] = useEvent()
107
108
  const [{ parsePrice, parseDate }] = useUtils()
108
109
  const [, { deleteUserCustomer }] = useCustomer()
109
110
  const [{ carts }, { refreshOrderOptions }] = useOrder()
110
- const [orderingTheme] = useOrderingTheme()
111
111
  const [openMessages, setOpenMessages] = useState({ business: false, driver: false })
112
112
  const [isOrderReviewed, setIsOrderReviewed] = useState(false)
113
113
  const [isProductReviewed, setIsProductReviewed] = useState(false)
@@ -134,7 +134,7 @@ const OrderDetailsUI = (props) => {
134
134
  const hideOrderActions = order?.delivery_type === 1
135
135
  const isGiftCardOrder = !order?.business_id
136
136
 
137
- const isOriginalLayout = orderingTheme?.theme?.confirmation?.components?.layout?.type === 'original'
137
+ const isOriginalLayout = theme?.confirmation?.components?.layout?.type === 'original'
138
138
  const hideDeliveryType = theme?.confirmation?.components?.order?.components?.delivery_type?.hidden
139
139
  const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
140
140
  const hideDeliveryProgress = theme?.confirmation?.components?.order?.components?.progress?.hidden
@@ -369,6 +369,10 @@ const OrderDetailsUI = (props) => {
369
369
  const _isService = order.products.some(product => product.type === 'service')
370
370
  setIsService(_isService)
371
371
  businessLogoUrlValidation()
372
+ props.openBChatByParam && setOpenMessages({
373
+ ...openMessages,
374
+ business: !!props.openBChatByParam
375
+ })
372
376
  }, [order])
373
377
 
374
378
  useEffect(() => {
@@ -470,16 +474,18 @@ const OrderDetailsUI = (props) => {
470
474
  >
471
475
  <span onClick={() => setIsOrderHistory(true)}>{t('VIEW_DETAILS', 'View details')}</span>
472
476
  </ReviewOrderLink>
473
- <ReviewOrderLink
474
- className='Review-order'
475
- active={
476
- acceptedStatus.includes(parseInt(order?.status, 10)) &&
477
- (!order?.review || (order.driver && !order?.user_review)) &&
478
- (!isOrderReviewed || !isProductReviewed || (isService && !isProReviewed) || !isDriverReviewed)
479
- }
480
- >
481
- <span onClick={handleOpenReview}>{t('REVIEW_ORDER', theme?.defaultLanguages?.REVIEW_ORDER || 'Review your Order')}</span>
482
- </ReviewOrderLink>
477
+ {(!props.isCustomerMode || (props.isCustomerMode && !!props.hashKey && !token)) && (
478
+ <ReviewOrderLink
479
+ className='Review-order'
480
+ active={
481
+ [...acceptedStatus, 16].includes(parseInt(order?.status, 10)) &&
482
+ (!order?.review || (order.driver && !order?.user_review)) &&
483
+ (!isOrderReviewed || !isProductReviewed || (isService && !isProReviewed) || !isDriverReviewed)
484
+ }
485
+ >
486
+ <span onClick={handleOpenReview}>{t('REVIEW_ORDER', theme?.defaultLanguages?.REVIEW_ORDER || 'Review your Order')}</span>
487
+ </ReviewOrderLink>
488
+ )}
483
489
  </LinkWrapper>
484
490
  </OrderStatusAndLinkContainer>
485
491
  </>
@@ -762,13 +768,36 @@ const OrderDetailsUI = (props) => {
762
768
  >
763
769
  <ReviewWrapper>
764
770
  {
765
- reviewStatus?.order
766
- ? <ReviewOrder order={order} closeReviewOrder={closeReviewOrder} setIsReviewed={setIsOrderReviewed} />
767
- : (reviewStatus?.product
768
- ? <ReviewProduct order={order} closeReviewProduct={closeReviewProduct} setIsProductReviewed={setIsProductReviewed} />
769
- : (reviewStatus?.professional
770
- ? <ReviewProfessional order={order} closeReviewProfessional={handleCloseReivew} setIsProfessionalReviewed={setIsProReviewed} isProfessional />
771
- : <ReviewDriver order={order} closeReviewDriver={handleCloseReivew} setIsDriverReviewed={setIsDriverReviewed} />))
771
+ reviewStatus?.order ? (
772
+ <ReviewOrder
773
+ order={order}
774
+ hashKey={props.hashKey}
775
+ closeReviewOrder={closeReviewOrder}
776
+ setIsReviewed={setIsOrderReviewed}
777
+ />)
778
+ : (reviewStatus?.product ? (
779
+ <ReviewProduct
780
+ order={order}
781
+ hashKey={props.hashKey}
782
+ closeReviewProduct={closeReviewProduct}
783
+ setIsProductReviewed={setIsProductReviewed}
784
+ />)
785
+ : (reviewStatus?.professional ? (
786
+ <ReviewProfessional
787
+ order={order}
788
+ hashKey={props.hashKey}
789
+ closeReviewProfessional={handleCloseReivew}
790
+ setIsProfessionalReviewed={setIsProReviewed}
791
+ isProfessional
792
+ />)
793
+ : (
794
+ <ReviewDriver
795
+ order={order}
796
+ hashKey={props.hashKey}
797
+ closeReviewDriver={handleCloseReivew}
798
+ setIsDriverReviewed={setIsDriverReviewed}
799
+ />
800
+ )))
772
801
  }
773
802
  </ReviewWrapper>
774
803
 
@@ -9,8 +9,7 @@ import {
9
9
  useUtils,
10
10
  useEvent,
11
11
  useToast, ToastType,
12
- useApi,
13
- useOrderingTheme
12
+ useApi
14
13
  } from 'ordering-components-external'
15
14
  import AiFillCheckCircle from '@meronex/icons/ai/AiFillCheckCircle'
16
15
 
@@ -59,7 +58,6 @@ const OrderDetailsUI = (props) => {
59
58
  const [events] = useEvent()
60
59
  const [{ parseDate }] = useUtils()
61
60
  const [, { showToast }] = useToast()
62
- const [orderingTheme] = useOrderingTheme()
63
61
  const optToSendReceipt = [
64
62
  {
65
63
  key: _EMAIL,
@@ -81,9 +79,9 @@ const OrderDetailsUI = (props) => {
81
79
 
82
80
  const { order, loading, error } = props.order
83
81
 
84
- const showDeliveryType = !orderingTheme?.theme?.confirmation?.components?.order?.components?.delivery_type?.hidden
85
- const showDeliveryDate = !orderingTheme?.theme?.confirmation?.components?.order?.components?.date?.hidden
86
- const showDeliveryProgress = !orderingTheme?.theme?.confirmation?.components?.order?.components?.progress?.hidden
82
+ const showDeliveryType = !theme?.confirmation?.components?.order?.components?.delivery_type?.hidden
83
+ const showDeliveryDate = !theme?.confirmation?.components?.order?.components?.date?.hidden
84
+ const showDeliveryProgress = !theme?.confirmation?.components?.order?.components?.progress?.hidden
87
85
 
88
86
  const locations = [
89
87
  { ...order?.driver?.location, icon: order?.driver?.photo || theme.images?.dummies?.driverPhoto },
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { useLanguage, OrderTypeControl, useOrder } from 'ordering-components-external'
2
+ import { useLanguage, useOrder, OrderTypeControl } from 'ordering-components-external'
3
3
  import { useTheme } from 'styled-components'
4
4
  import BsArrowRight from '@meronex/icons/bs/BsArrowRight'
5
5
  import {
@@ -109,6 +109,18 @@ export const OrderTypeSelectorContent = (props) => {
109
109
  text: t('DRIVE_THRU', 'Drive thru'),
110
110
  description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description'),
111
111
  image: theme.images?.deliveryTypes?.driveThru
112
+ },
113
+ {
114
+ value: 7,
115
+ text: t('CATERING_DELIVERY', 'Catering Delivery'),
116
+ description: t('ORDERTYPE_DESCRIPTION_CATERING_DELIVERY', 'Catering Delivery description'),
117
+ image: theme.images?.deliveryTypes?.cateringDelivery
118
+ },
119
+ {
120
+ value: 8,
121
+ text: t('CATERING_PICKUP', 'Catering Pickup'),
122
+ description: t('ORDERTYPE_DESCRIPTION_CATERING_PICKUP', 'Catering Pickup description'),
123
+ image: theme.images?.deliveryTypes?.cateringPickup
112
124
  }
113
125
  ]
114
126
  }
@@ -1,9 +1,10 @@
1
1
  import React from 'react'
2
- import { useOrder, useOrderingTheme } from 'ordering-components-external'
2
+ import { useOrder } from 'ordering-components-external'
3
3
  import { BusinessController } from '../../BusinessController'
4
4
  import { AutoScroll } from '../../AutoScroll'
5
5
  import { BusinessList, BusinessListWrapper } from './styles'
6
6
  import { useWindowSize } from '../../../../../../hooks/useWindowSize'
7
+ import { useTheme } from 'styled-components'
7
8
 
8
9
  export const PreviousBusinessOrdered = (props) => {
9
10
  const {
@@ -15,9 +16,9 @@ export const PreviousBusinessOrdered = (props) => {
15
16
  } = props
16
17
 
17
18
  const [orderState] = useOrder()
18
- const [orderingTheme] = useOrderingTheme()
19
+ const theme = useTheme()
19
20
  const { width } = useWindowSize()
20
- const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
21
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
21
22
 
22
23
  const onBusinessClick = (business) => {
23
24
  onRedirectPage({ page: 'business', params: { store: business.slug } })