ordering-ui-external 10.1.0 → 10.2.1

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 (147) hide show
  1. package/_bundles/{0.ordering-ui.e9827c5566d8cce0eaa4.js → 0.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  2. package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  3. package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  4. package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  5. package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  6. package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  7. package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +2 -2
  8. package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  9. package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
  10. package/_bundles/ordering-ui.d1a8d1fbf5b112d5d9a9.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 +14 -17
  21. package/_modules/themes/five/src/components/BusinessController/styles.js +1 -1
  22. package/_modules/themes/five/src/components/BusinessInformation/styles.js +19 -14
  23. package/_modules/themes/five/src/components/BusinessPreorder/index.js +51 -10
  24. package/_modules/themes/five/src/components/BusinessPreorder/styles.js +32 -25
  25. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -5
  26. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -4
  27. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +11 -12
  28. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +22 -3
  29. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -10
  30. package/_modules/themes/five/src/components/Cart/index.js +17 -9
  31. package/_modules/themes/five/src/components/CartPopover/index.js +4 -7
  32. package/_modules/themes/five/src/components/CartPopover/styles.js +4 -1
  33. package/_modules/themes/five/src/components/Checkout/index.js +8 -8
  34. package/_modules/themes/five/src/components/Confirm/styles.js +16 -13
  35. package/_modules/themes/five/src/components/DatePicker/index.js +2 -1
  36. package/_modules/themes/five/src/components/Favorite/index.js +4 -5
  37. package/_modules/themes/five/src/components/Footer/index.js +2 -3
  38. package/_modules/themes/five/src/components/Header/index.js +5 -8
  39. package/_modules/themes/five/src/components/HeaderOption/index.js +4 -5
  40. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -10
  41. package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
  42. package/_modules/themes/five/src/components/Modal/styles.js +4 -2
  43. package/_modules/themes/five/src/components/MomentContent/index.js +16 -6
  44. package/_modules/themes/five/src/components/MomentControl/index.js +44 -34
  45. package/_modules/themes/five/src/components/MomentControl/styles.js +49 -27
  46. package/_modules/themes/five/src/components/OrderDetails/index.js +31 -24
  47. package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -7
  48. package/_modules/themes/five/src/components/OrderProgress/index.js +5 -1
  49. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +11 -1
  50. package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
  51. package/_modules/themes/five/src/components/OrdersOption/index.js +7 -22
  52. package/_modules/themes/five/src/components/OrdersOption/styles.js +38 -35
  53. package/_modules/themes/five/src/components/PageBanner/index.js +79 -58
  54. package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +2 -1
  55. package/_modules/themes/five/src/components/ProductForm/styles.js +12 -9
  56. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +0 -3
  57. package/_modules/themes/five/src/components/ProductOption/styles.js +4 -1
  58. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +8 -9
  59. package/_modules/themes/five/src/components/SignUpForm/index.js +5 -5
  60. package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +0 -3
  61. package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
  62. package/_modules/themes/five/src/components/UserDetails/styles.js +1 -1
  63. package/_modules/themes/five/src/components/UserFormDetails/index.js +3 -6
  64. package/_modules/themes/five/src/components/UserPopover/index.js +3 -6
  65. package/_modules/themes/five/src/components/UserPopover/styles.js +8 -5
  66. package/_modules/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -5
  67. package/_modules/themes/five/src/components/UserProfileForm/index.js +2 -5
  68. package/_modules/themes/six/src/components/BusinessBasicInformation/index.js +8 -9
  69. package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -6
  70. package/package.json +2 -2
  71. package/src/components/BusinessBasicInformation/index.js +7 -8
  72. package/src/components/OrderDetails/index.js +14 -16
  73. package/src/components/ProductItemAccordion/index.js +4 -3
  74. package/src/components/RenderProductsLayout/SearchProducts/index.js +2 -3
  75. package/src/components/UserFormDetails/index.js +6 -5
  76. package/src/components/UserProfileForm/ProfileOptions/index.js +4 -4
  77. package/src/components/UserProfileForm/index.js +10 -10
  78. package/src/contexts/ThemeContext/index.js +1 -1
  79. package/src/themes/five/src/components/AddressForm/index.js +1 -2
  80. package/src/themes/five/src/components/AddressList/index.js +1 -3
  81. package/src/themes/five/src/components/BusinessController/index.js +5 -7
  82. package/src/themes/five/src/components/BusinessController/styles.js +1 -1
  83. package/src/themes/five/src/components/BusinessInformation/index.js +1 -2
  84. package/src/themes/five/src/components/BusinessInformation/styles.js +2 -2
  85. package/src/themes/five/src/components/BusinessPreorder/index.js +61 -10
  86. package/src/themes/five/src/components/BusinessPreorder/styles.js +93 -43
  87. package/src/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
  88. package/src/themes/five/src/components/BusinessProductsList/index.js +1 -2
  89. package/src/themes/five/src/components/BusinessProductsListing/index.js +10 -3
  90. package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
  91. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +17 -0
  92. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -7
  93. package/src/themes/five/src/components/Cart/index.js +11 -4
  94. package/src/themes/five/src/components/CartPopover/index.js +2 -3
  95. package/src/themes/five/src/components/CartPopover/styles.js +1 -1
  96. package/src/themes/five/src/components/Checkout/index.js +5 -6
  97. package/src/themes/five/src/components/Confirm/styles.js +1 -1
  98. package/src/themes/five/src/components/DatePicker/index.js +1 -0
  99. package/src/themes/five/src/components/Favorite/index.js +4 -3
  100. package/src/themes/five/src/components/Footer/index.js +3 -2
  101. package/src/themes/five/src/components/Header/index.js +4 -5
  102. package/src/themes/five/src/components/HeaderOption/index.js +4 -3
  103. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -8
  104. package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -0
  105. package/src/themes/five/src/components/Modal/styles.js +1 -1
  106. package/src/themes/five/src/components/MomentContent/index.js +17 -8
  107. package/src/themes/five/src/components/MomentControl/index.js +83 -45
  108. package/src/themes/five/src/components/MomentControl/styles.js +137 -34
  109. package/src/themes/five/src/components/MyOrders/index.js +1 -1
  110. package/src/themes/five/src/components/OrderDetails/index.js +50 -21
  111. package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -6
  112. package/src/themes/five/src/components/OrderProgress/index.js +5 -1
  113. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +13 -1
  114. package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
  115. package/src/themes/five/src/components/OrdersOption/index.js +3 -17
  116. package/src/themes/five/src/components/OrdersOption/styles.js +3 -4
  117. package/src/themes/five/src/components/PageBanner/index.js +65 -51
  118. package/src/themes/five/src/components/PhoneAutocomplete/index.js +1 -0
  119. package/src/themes/five/src/components/ProductForm/styles.js +1 -1
  120. package/src/themes/five/src/components/ProductItemAccordion/index.js +1 -2
  121. package/src/themes/five/src/components/ProductOption/styles.js +1 -1
  122. package/src/themes/five/src/components/RenderProductsLayout/index.js +9 -6
  123. package/src/themes/five/src/components/SignUpForm/index.js +6 -6
  124. package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +1 -2
  125. package/src/themes/five/src/components/UserDetails/index.js +1 -1
  126. package/src/themes/five/src/components/UserDetails/styles.js +3 -0
  127. package/src/themes/five/src/components/UserFormDetails/index.js +3 -4
  128. package/src/themes/five/src/components/UserPopover/index.js +3 -4
  129. package/src/themes/five/src/components/UserPopover/styles.js +1 -1
  130. package/src/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -3
  131. package/src/themes/five/src/components/UserProfileForm/index.js +2 -4
  132. package/src/themes/six/src/components/BusinessBasicInformation/index.js +8 -7
  133. package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +2 -3
  134. package/template/app.js +15 -10
  135. package/template/components/HelmetTags/index.js +3 -2
  136. package/template/pages/AddressList/index.js +4 -3
  137. package/template/pages/BusinessProductsList/index.js +5 -4
  138. package/template/pages/BusinessesList/index.js +6 -6
  139. package/template/pages/Checkout/index.js +6 -4
  140. package/template/pages/Home/index.js +4 -2
  141. package/template/pages/MessagesList/index.js +5 -4
  142. package/template/pages/MyOrders/index.js +6 -5
  143. package/template/pages/OrderDetails/index.js +4 -3
  144. package/_bundles/ordering-ui.e9827c5566d8cce0eaa4.js +0 -2
  145. package/template/components/OrderingThemeUpdated/index.js +0 -41
  146. /package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js.LICENSE.txt} +0 -0
  147. /package/_bundles/{ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → ordering-ui.d1a8d1fbf5b112d5d9a9.js.LICENSE.txt} +0 -0
@@ -153,53 +153,75 @@ export const TimeListWrapper = styled.div`
153
153
  export const TimeItem = styled.div`
154
154
  cursor: pointer;
155
155
  display: flex;
156
- justify-content: center;
157
- align-items: center;
158
- ${({ isProfessional }) => isProfessional ? css`
159
- background: ${props => props.theme.colors.primaryContrast};
160
- color: ${props => props.theme.colors.primary};
161
- ` : css`
162
- background: ${props => props.theme.colors.gray200};
163
- `}
164
- border-radius: 7.6px;
165
- padding: 5px 15px;
166
- margin: 12px;
167
- width: calc(50% - 24px);
168
- min-width: calc(50% - 24px);
169
- box-sizing: border-box;
170
- user-select: none;
171
-
156
+ span {
157
+ font-size: 14px;
158
+ white-space: nowrap;
159
+ }
172
160
  ${({ active }) => active && css`
173
161
  background: #F5F9FF;
174
162
  color: ${props => props.theme.colors.primary};
175
163
  `}
176
-
177
- ${({ isDisabled }) => isDisabled && css`
178
- pointer-events: none;
179
- `}
180
-
181
- ${({ busyTime }) => busyTime && css`
182
- background: ${props => props.theme.colors.gray200};
183
- color: ${props => props.theme.colors.lightGray};
184
- `}
185
-
186
- span {
187
- font-size: 14px;
188
- }
189
-
190
- @media (min-width: 400px) {
191
- width: calc(33.33% - 24px);
192
- min-width: calc(33.33% - 24px);
193
- }
194
-
195
- @media (min-width: 576px) {
196
- width: calc(25% - 24px);
197
- min-width: calc(25% - 24px);
198
- }
199
-
200
- @media (min-width: 769px) {
201
- width: calc(16.66% - 24px);
202
- min-width: calc(16.66% - 24px);
164
+ ${({ cateringPreorder }) => cateringPreorder ? css`
165
+ background: ${(props) => props.theme?.colors?.backgroundPage};
166
+ width: 100%;
167
+ min-width: 100%;
168
+ height: 50px;
169
+
170
+ span {
171
+ font-size: 18px;
172
+ display: flex;
173
+ align-items: center;
174
+ margin: 10px 0;
175
+ margin-left: 15px;
176
+ p{
177
+ position: relative;
178
+ bottom: 2px;
179
+ }
180
+ }
181
+ ${({ active }) => active && css`
182
+ background: #F5F9FF;
183
+ color: ${props => props.theme.colors.primary};
184
+ span {
185
+ p{
186
+ bottom: 0;
187
+ margin-left: 2px;
188
+ }
189
+ }
190
+ `}
191
+ ` : css`
192
+ justify-content: center;
193
+ align-items: center;
194
+ background: #E9ECEF;
195
+ border-radius: 7.6px;
196
+ padding: 5px 15px;
197
+ margin: 12px;
198
+ width: calc(50% - 24px);
199
+ min-width: calc(50% - 24px);
200
+ box-sizing: border-box;
201
+ user-select: none;
202
+
203
+ @media (min-width: 400px) {
204
+ width: calc(33.33% - 24px);
205
+ min-width: calc(33.33% - 24px);
206
+ }
207
+
208
+ @media (min-width: 576px) {
209
+ width: calc(25% - 24px);
210
+ min-width: calc(25% - 24px);
211
+ }
212
+
213
+ @media (min-width: 769px) {
214
+ width: calc(33.33% - 24px);
215
+ min-width: calc(33.33% - 24px);
216
+ ${({ isAppoint }) => isAppoint && css`
217
+ width: calc(33.33% - 24px);
218
+ min-width: calc(33.33% - 24px);
219
+ span {
220
+ font-size: 12px;
221
+ }
222
+ `}
223
+ }
224
+ `
203
225
  }
204
226
  `
205
227
 
@@ -320,3 +342,31 @@ export const ClosedBusinessMsg = styled.div`
320
342
  font-size: 16px;
321
343
  width: 100%;
322
344
  `
345
+
346
+ export const CheckIcon = styled.div`
347
+ margin-right: 20px;
348
+ svg {
349
+ width: 24px;
350
+ height: 24px;
351
+ }
352
+ `
353
+
354
+ export const CheckedIcon = styled.div`
355
+ border-radius: 50%;
356
+ width: 20px;
357
+ min-width: 20px;
358
+ height: 20px;
359
+ box-sizing: border-box;
360
+ border: 6px solid ${props => props.theme.colors?.primary};
361
+ margin: 2px 12px 2px 2px;
362
+ ${props => props.theme.rtl && css`
363
+ margin: 2px 2px 2px 12px;
364
+ `}
365
+ ${({ cateringPreorder }) => cateringPreorder && css`
366
+ width: 21px;
367
+ min-width: 21px;
368
+ height: 21px;
369
+ margin: 0;
370
+ margin-left: 1px;
371
+ `}
372
+ `
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import Skeleton from 'react-loading-skeleton'
3
- import { BusinessProductsCategories as ProductsCategories, useOrderingTheme } from 'ordering-components-external'
3
+ import { BusinessProductsCategories as ProductsCategories } from 'ordering-components-external'
4
4
  import { AutoScroll } from '../../../../../components/AutoScroll'
5
5
  import { useTheme } from 'styled-components'
6
6
 
@@ -23,11 +23,10 @@ const BusinessProductsCategoriesUI = (props) => {
23
23
 
24
24
  const theme = useTheme()
25
25
  const windowSize = useWindowSize()
26
- const [orderingTheme] = useOrderingTheme()
27
26
  const [selectedCategory, setSelectedCateogry] = useState({ id: null })
28
27
  const scrollTopSpan = 60
29
28
 
30
- const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
29
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
31
30
 
32
31
  const handleChangeCategory = (category) => {
33
32
  const isBlockScroll = window.location.search.includes('category') &&
@@ -147,8 +147,7 @@ const BusinessProductsListUI = (props) => {
147
147
  handleUpdateProducts={handleUpdateProducts}
148
148
  productAddedToCartLength={currentCart?.products?.reduce((productsLength, Cproduct) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
149
149
  />
150
- ))
151
- }
150
+ ))}
152
151
  </ProductsListing>
153
152
  {isSearchMode && category?.subcategories?.length > 0 && category?.subcategories?.filter(subcategory => productsCategorySelected?.some(product => product?.category_id === subcategory?.id))?.map(subcategory => (
154
153
  <SubcategorySearchContainer key={subcategory?.id}>
@@ -130,6 +130,13 @@ const BusinessProductsListingUI = (props) => {
130
130
  { value: 'a-z', content: t('A_to_Z', theme?.defaultLanguages?.A_to_Z || 'A-Z'), showOnSelected: t('A_to_Z', theme?.defaultLanguages?.A_to_Z || 'A-Z') }
131
131
  ]
132
132
 
133
+ const subtotalWithTaxes = currentCart?.taxes?.reduce((acc, item) => {
134
+ if (item?.type === 1) {
135
+ return acc = acc + item?.summary?.tax
136
+ }
137
+ return acc = acc
138
+ }, currentCart?.subtotal)
139
+
133
140
  const handler = () => {
134
141
  setOpenBusinessInformation(true)
135
142
  }
@@ -443,14 +450,14 @@ const BusinessProductsListingUI = (props) => {
443
450
  btnText={
444
451
  !currentCart?.valid_maximum ? (
445
452
  `${t('MAXIMUM_SUBTOTAL_ORDER', theme?.defaultLanguages?.MAXIMUM_SUBTOTAL_ORDER || 'Maximum subtotal order')}: ${parsePrice(currentCart?.maximum)}`
446
- ) : (!currentCart?.valid_minimum && !(currentCart?.discount_type === 1 && currentCart?.discount_rate === 100)) ? (
453
+ ) : (subtotalWithTaxes < currentCart?.minimum) ? (
447
454
  `${t('MINIMUN_SUBTOTAL_ORDER', theme?.defaultLanguages?.MINIMUN_SUBTOTAL_ORDER || 'Minimum subtotal order:')} ${parsePrice(currentCart?.minimum)}`
448
455
  ) : !openUpselling !== canOpenUpselling ? t('VIEW_ORDER', theme?.defaultLanguages?.VIEW_ORDER || 'View Order') : t('LOADING', theme?.defaultLanguages?.LOADING || 'Loading')
449
456
  }
450
- isSecondaryBtn={!currentCart?.valid_maximum || (!currentCart?.valid_minimum && !(currentCart?.discount_type === 1 && currentCart?.discount_rate === 100))}
457
+ isSecondaryBtn={!currentCart?.valid_maximum || subtotalWithTaxes < currentCart?.minimum}
451
458
  btnValue={currentCart?.products?.length}
452
459
  handleClick={() => setOpenUpselling(true)}
453
- disabled={openUpselling || !currentCart?.valid_maximum || (!currentCart?.valid_minimum && !(currentCart?.discount_type === 1 && currentCart?.discount_rate === 100))}
460
+ disabled={openUpselling || !currentCart?.valid_maximum || subtotalWithTaxes < currentCart?.minimum}
454
461
  />
455
462
  )}
456
463
  {(windowSize.width < 1000 || windowSize.height < 600) && currentCart?.products?.length > 0 && (
@@ -10,7 +10,7 @@ export const ProductsContainer = styled.div`
10
10
  margin-bottom: 5px;
11
11
  }
12
12
  > div {
13
- background-color: ${({ theme }) => theme?.business_view?.components?.style?.backgroundColor};
13
+ background-color: ${(props) => props.theme?.colors?.backgroundPage};
14
14
  }
15
15
 
16
16
  `
@@ -13,11 +13,21 @@ export const OrdersSection = (props) => {
13
13
  } = props
14
14
  const [orderState] = useOrder()
15
15
  const [, t] = useLanguage()
16
+
17
+ const propsToFetchBusiness = ['name', 'logo', 'slug', 'id']
18
+ const propsToFetch = ['cart', 'business', 'status', 'id', 'uuid', 'cart_group_id', 'business_id', 'delivery_datetime', 'delivery_datetime_utc', 'total', 'summary']
19
+
20
+ const handleRedirectToCheckout = (uuid) => {
21
+ onRedirectPage && onRedirectPage({ page: 'checkout', params: { cartUuid: uuid } })
22
+ }
23
+
16
24
  return (
17
25
  <>
18
26
  {onRedirectPage && (
19
27
  <>
20
28
  <OrdersOption
29
+ propsToFetch={propsToFetch}
30
+ propsToFetchBusiness={propsToFetchBusiness}
21
31
  horizontal
22
32
  isBusinessesPage
23
33
  onRedirectPage={onRedirectPage}
@@ -30,8 +40,11 @@ export const OrdersSection = (props) => {
30
40
  isBusinessesLoading={businessesList.loading}
31
41
  isCustomerMode={isCustomerMode}
32
42
  franchiseId={props.franchiseId}
43
+ handleRedirectToCheckout={handleRedirectToCheckout}
33
44
  />
34
45
  <OrdersOption
46
+ propsToFetch={propsToFetch}
47
+ propsToFetchBusiness={propsToFetchBusiness}
35
48
  activeOrders
36
49
  horizontal
37
50
  asDashboard
@@ -44,8 +57,11 @@ export const OrdersSection = (props) => {
44
57
  isBusinessesLoading={businessesList.loading}
45
58
  isCustomerMode={isCustomerMode}
46
59
  franchiseId={props.franchiseId}
60
+ handleRedirectToCheckout={handleRedirectToCheckout}
47
61
  />
48
62
  <OrdersOption
63
+ propsToFetch={propsToFetch}
64
+ propsToFetchBusiness={propsToFetchBusiness}
49
65
  pastOrders
50
66
  horizontal
51
67
  asDashboard
@@ -58,6 +74,7 @@ export const OrdersSection = (props) => {
58
74
  isBusinessesLoading={businessesList.loading}
59
75
  isCustomerMode={isCustomerMode}
60
76
  franchiseId={props.franchiseId}
77
+ handleRedirectToCheckout={handleRedirectToCheckout}
61
78
  />
62
79
  </>
63
80
  )}
@@ -7,8 +7,7 @@ import {
7
7
  useSession,
8
8
  useLanguage,
9
9
  useConfig,
10
- BusinessList as BusinessListController,
11
- useOrderingTheme
10
+ BusinessList as BusinessListController
12
11
  } from 'ordering-components-external'
13
12
 
14
13
  import {
@@ -79,7 +78,6 @@ const BusinessesListingUI = (props) => {
79
78
  const [{ auth }] = useSession()
80
79
  const [{ configs }] = useConfig()
81
80
  const windowSize = useWindowSize()
82
- const [orderingTheme] = useOrderingTheme()
83
81
  const theme = useTheme()
84
82
  const [modals, setModals] = useState({ listOpen: false, formOpen: false, citiesOpen: false })
85
83
  const [alertState, setAlertState] = useState({ open: false, content: [] })
@@ -101,7 +99,7 @@ const BusinessesListingUI = (props) => {
101
99
  const isAllCategoriesHidden = theme?.business_listing_view?.components?.categories?.hidden
102
100
  const businessesIds = businessesList.businesses &&
103
101
  businessesList.businesses?.map(business => business.id)
104
- const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
102
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
105
103
  const cateringTypeString = orderState?.options?.type === 7
106
104
  ? 'catering_delivery'
107
105
  : orderState?.options?.type === 8
@@ -226,9 +224,10 @@ const BusinessesListingUI = (props) => {
226
224
 
227
225
  return (
228
226
  <BusinessContainer>
229
- {!isCustomerMode && ( // Keep this banner at the top
230
- <PageBanner position='web_business_listing' />
231
- )}
227
+ <PageBanner
228
+ position='web_business_listing'
229
+ isCustomerMode={isCustomerMode}
230
+ />
232
231
 
233
232
  {(windowSize.width < 576 || (configs?.business_listing_hide_image?.value !== '1' && !isChew)) && (
234
233
  <BusinessBanner>
@@ -136,6 +136,13 @@ const CartUI = (props) => {
136
136
  }
137
137
  }
138
138
 
139
+ const subtotalWithTaxes = cart?.taxes?.reduce((acc, item) => {
140
+ if (item?.type === 1) {
141
+ return acc = acc + item?.summary?.tax
142
+ }
143
+ return acc = acc
144
+ }, cart?.subtotal)
145
+ console.log('cart', cart)
139
146
  const clearAmount = (value) => parseFloat((Math.trunc(value * 100) / 100).toFixed(configs.format_number_decimal_length?.value ?? 2))
140
147
  const loyaltyRewardValue = clearAmount((cart?.subtotal + getIncludedTaxes()) * loyaltyRewardRate)
141
148
 
@@ -610,19 +617,19 @@ const CartUI = (props) => {
610
617
  />
611
618
  </div>
612
619
  )}
613
- {(onClickCheckout || isForceOpenCart) && !isCheckout && cart?.valid_products && (!isMultiCheckout || isStore) && (
620
+ {(onClickCheckout || isForceOpenCart) && !isCheckout && cart?.valid && (!isMultiCheckout || isStore) && (
614
621
  <CheckoutAction>
615
622
  <p>{cart?.total >= 1 && parsePrice(cart?.total)}</p>
616
623
  <Button
617
- color={(!cart?.valid_maximum || (!cart?.valid_minimum && !(cart?.discount_type === 1 && cart?.discount_rate === 100)) || !cart?.valid_address) ? 'secundary' : 'primary'}
624
+ color={(!cart?.valid_maximum || subtotalWithTaxes < cart?.minimum || !cart?.valid_address) ? 'secundary' : 'primary'}
618
625
  onClick={() => checkOutBtnClick(cart?.uuid)}
619
- disabled={(openUpselling && !canOpenUpselling) || !cart?.valid_maximum || (!cart?.valid_minimum && !(cart?.discount_type === 1 && cart?.discount_rate === 100)) || !cart?.valid_address}
626
+ disabled={(openUpselling && !canOpenUpselling) || !cart?.valid_maximum || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
620
627
  >
621
628
  {!cart?.valid_address ? (
622
629
  t('OUT_OF_COVERAGE', 'Out of Coverage')
623
630
  ) : !cart?.valid_maximum ? (
624
631
  `${t('MAXIMUM_SUBTOTAL_ORDER', 'Maximum subtotal order')}: ${parsePrice(cart?.maximum)}`
625
- ) : (!cart?.valid_minimum && !(cart?.discount_type === 1 && cart?.discount_rate === 100)) ? (
632
+ ) : subtotalWithTaxes < cart?.minimum ? (
626
633
  `${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`
627
634
  ) : !openUpselling ^ canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')}
628
635
  </Button>
@@ -9,7 +9,7 @@ import {
9
9
  Title
10
10
  } from './styles'
11
11
 
12
- import { useOrder, useEvent, useLanguage, useOrderingTheme } from 'ordering-components-external'
12
+ import { useOrder, useEvent, useLanguage } from 'ordering-components-external'
13
13
  import { useTheme } from 'styled-components'
14
14
  import { CartContent } from '../CartContent'
15
15
  import { Modal } from '../Modal'
@@ -22,11 +22,10 @@ export const CartPopover = (props) => {
22
22
  const theme = useTheme()
23
23
  const [events] = useEvent()
24
24
  const [, t] = useLanguage()
25
- const [orderingTheme] = useOrderingTheme()
26
25
  const referenceElement = useRef()
27
26
  const popperElement = useRef()
28
27
  const arrowElement = useRef()
29
- const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
28
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
30
29
  const popper = usePopper(referenceElement.current, popperElement.current, {
31
30
  placement: theme?.rtl ? 'bottom' : 'bottom-end',
32
31
  modifiers: [
@@ -26,7 +26,7 @@ export const HeaderItem = styled.div`
26
26
  `
27
27
 
28
28
  export const PopoverBody = styled.div`
29
- background-color: #FFF;
29
+ background-color: ${(props) => props.theme?.colors?.backgroundPage};
30
30
  color: #333;
31
31
  padding: 15px;
32
32
  border-radius: 10px;
@@ -13,7 +13,6 @@ import {
13
13
  useValidationFields,
14
14
  useConfig,
15
15
  useCustomer,
16
- useOrderingTheme,
17
16
  useEvent
18
17
  } from 'ordering-components-external'
19
18
  import { useWindowSize } from '../../../../../hooks/useWindowSize'
@@ -105,11 +104,10 @@ const CheckoutUI = (props) => {
105
104
 
106
105
  const theme = useTheme()
107
106
  const [validationFields] = useValidationFields()
108
- const [orderingTheme] = useOrderingTheme()
109
107
  const [{ options, loading }] = useOrder()
110
108
  const [, t] = useLanguage()
111
109
  const [{ parsePrice }] = useUtils()
112
- const [{ user }, { login }] = useSession()
110
+ const [{ user, loading: userLoading }, { login }] = useSession()
113
111
  const [{ configs }] = useConfig()
114
112
  const [customerState] = useCustomer()
115
113
  const [events] = useEvent()
@@ -137,7 +135,7 @@ const CheckoutUI = (props) => {
137
135
  const isWalletCreditPointsEnabled = businessConfigs.find(config => config.key === 'wallet_credit_point_enabled')?.value === '1'
138
136
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' &&
139
137
  (isWalletCashEnabled || isWalletCreditPointsEnabled) && !useKioskApp && !isCustomerMode
140
- const isMultiDriverTips = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
138
+ const isMultiDriverTips = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
141
139
 
142
140
  const placeSpotTypes = [3, 4, 5]
143
141
  const placeSpotsEnabled = placeSpotTypes.includes(options?.type) && !useKioskApp
@@ -170,7 +168,7 @@ const CheckoutUI = (props) => {
170
168
  ? JSON.parse(configs?.driver_tip_options?.value) || []
171
169
  : configs?.driver_tip_options?.value || []
172
170
 
173
- const deliveryOptions = instructionsOptions?.result && instructionsOptions?.result?.filter(option => option?.enabled)?.map(option => {
171
+ const deliveryOptions = instructionsOptions?.result && Array.isArray(instructionsOptions?.result) && instructionsOptions?.result?.filter(option => option?.enabled)?.map(option => {
174
172
  return {
175
173
  value: option?.id, content: t(option?.name.toUpperCase().replace(/\s/g, '_'), option?.name), showOnSelected: t(option?.name.toUpperCase().replace(/\s/g, '_'), option?.name)
176
174
  }
@@ -186,6 +184,7 @@ const CheckoutUI = (props) => {
186
184
  const creditPointPlanOnBusiness = creditPointPlan?.businesses?.find(b => b.business_id === cart?.business_id && b.accumulates)
187
185
 
188
186
  const handlePlaceOrder = () => {
187
+ if (placing) return
189
188
  if (stripePaymethods.includes(paymethodSelected?.gateway) && user?.guest_id) {
190
189
  setOpenModal({ ...openModal, signup: true, isGuest: true })
191
190
  return
@@ -290,7 +289,7 @@ const CheckoutUI = (props) => {
290
289
  }
291
290
 
292
291
  useEffect(() => {
293
- if (validationFields && validationFields?.fields?.checkout) {
292
+ if (validationFields && validationFields?.fields?.checkout && !customerState.loading && !userLoading) {
294
293
  checkValidationFields()
295
294
  }
296
295
  }, [validationFields, user, customerState])
@@ -24,7 +24,7 @@ export const PopupWrap = styled.div`
24
24
  `
25
25
 
26
26
  export const PopupDialog = styled.div`
27
- background-color: #FFF;
27
+ background-color: ${(props) => props.theme?.colors?.backgroundPage};
28
28
  padding: 20px;
29
29
  width: 70%;
30
30
  border-radius: 10px;
@@ -14,6 +14,7 @@ export const DatePickerUI = props => {
14
14
  date={value}
15
15
  name={name}
16
16
  onChange={onChange}
17
+ maxDate={new Date()}
17
18
  />
18
19
  </DateContainer>
19
20
  )
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { useLanguage, useOrder, useOrderingTheme } from 'ordering-components-external'
2
+ import { useLanguage, useOrder } from 'ordering-components-external'
3
3
  import { FavoriteList } from '../FavoriteList'
4
4
  import { Tabs } from '../../styles/Tabs'
5
5
  import {
@@ -9,12 +9,13 @@ import {
9
9
  Tab,
10
10
  ContentWrapper
11
11
  } from './styles'
12
+ import { useTheme } from 'styled-components'
12
13
 
13
14
  export const Favorite = (props) => {
14
15
  const [, t] = useLanguage()
15
- const [orderingTheme] = useOrderingTheme()
16
16
  const [orderState] = useOrder()
17
- const layout = orderingTheme?.theme?.favorite?.components?.layout?.type || 'original'
17
+ const theme = useTheme()
18
+ const layout = theme?.favorite?.components?.layout?.type || 'original'
18
19
 
19
20
  const [tabSelected, setTabSelected] = useState('businesses')
20
21
 
@@ -1,12 +1,13 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useApi, useConfig, useLanguage, useOrderingTheme } from 'ordering-components-external'
2
+ import { useApi, useConfig, useLanguage } from 'ordering-components-external'
3
3
 
4
4
  import { Container, PoweredByOrdering } from './styles'
5
+ import { useTheme } from 'styled-components'
5
6
 
6
7
  export const Footer = ({ isFooterPage }) => {
7
8
  const [footerState, setfooterState] = useState({ body: null, loading: false, error: null })
8
9
  const [ordering] = useApi()
9
- const [{ theme }] = useOrderingTheme()
10
+ const theme = useTheme()
10
11
  const requestsState = {}
11
12
  const [{ configs }] = useConfig()
12
13
  const [, t] = useLanguage()
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useRef } from 'react'
2
2
  import { useLocation } from 'react-router-dom'
3
- import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils, useOrderingTheme, useBusiness } from 'ordering-components-external'
3
+ import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils, useBusiness } from 'ordering-components-external'
4
4
  import { useTheme } from 'styled-components'
5
5
  import AiOutlineClose from '@meronex/icons/ai/AiOutlineClose'
6
6
  import { LanguageSelector } from '../../../../../components/LanguageSelector'
@@ -75,7 +75,6 @@ export const Header = (props) => {
75
75
  const theme = useTheme()
76
76
  const [configState] = useConfig()
77
77
  const [customerState, { deleteUserCustomer }] = useCustomer()
78
- const [orderingTheme] = useOrderingTheme()
79
78
  const [{ business }] = useBusiness()
80
79
 
81
80
  const clearCustomer = useRef(null)
@@ -105,7 +104,7 @@ export const Header = (props) => {
105
104
  const orderTypeList = [t('DELIVERY', 'Delivery'), t('PICKUP', 'Pickup'), t('EAT_IN', 'Eat in'), t('CURBSIDE', 'Curbside'), t('DRIVE_THRU', 'Drive thru'), '', t('CATERING_DELIVERY', 'Catering Delivery'), t('CATERING_PICKUP', 'Catering pickup')]
106
105
  const configTypes = configState?.configs?.order_types_allowed?.value.split('|').map(value => Number(value)) || []
107
106
  const isPreOrderSetting = configState?.configs?.preorder_status_enabled?.value === '1'
108
- const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
107
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
109
108
  const isHideLanguages = theme?.header?.components?.language_selector?.hidden
110
109
  const cateringTypeString = orderState?.options?.type === 7
111
110
  ? 'catering_delivery'
@@ -241,8 +240,8 @@ export const Header = (props) => {
241
240
  onClick={() => handleGoToPage({ page: orderState?.options?.address?.location && !isCustomerMode ? 'search' : 'home' })}
242
241
  isChew={isChew}
243
242
  >
244
- <img alt='Logotype' width='170px' height={isChew ? '35px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.logotype} loading='lazy' />
245
- <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : (windowSize.width <= 768 ? theme?.images?.logos?.isotypeInvert : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.isotype)} loading='lazy' />
243
+ <img alt='Logotype' width='170px' height={isChew ? '35px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.logotype} loading='lazy' />
244
+ <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : (windowSize.width <= 768 ? theme?.images?.logos?.isotypeInvert : theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.isotype)} loading='lazy' />
246
245
  </LogoHeader>
247
246
  </LeftHeader>
248
247
  {isShowOrderOptions && windowSize.width >= 576 && (
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { useUtils, useLanguage, useConfig, useOrder, useOrderingTheme } from 'ordering-components-external'
2
+ import { useUtils, useLanguage, useConfig, useOrder } from 'ordering-components-external'
3
3
  import AiOutlineShoppingCart from '@meronex/icons/ai/AiOutlineShoppingCart'
4
4
  import FaMapMarkerAlt from '@meronex/icons/fa/FaMapMarkerAlt'
5
5
 
@@ -7,6 +7,7 @@ import {
7
7
  Container,
8
8
  DeliveryType
9
9
  } from './styles'
10
+ import { useTheme } from 'styled-components'
10
11
 
11
12
  export const HeaderOption = (props) => {
12
13
  const {
@@ -19,10 +20,10 @@ export const HeaderOption = (props) => {
19
20
 
20
21
  const [{ configs }] = useConfig()
21
22
  const [{ parseDate }] = useUtils()
22
- const [orderingTheme] = useOrderingTheme()
23
23
  const [, t] = useLanguage()
24
24
  const [orderStatus] = useOrder()
25
- const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
25
+ const theme = useTheme()
26
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
26
27
 
27
28
  return (
28
29
  <>
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useTheme } from 'styled-components'
3
- import { useSession, useOrder, useLanguage, useOrderingTheme, useConfig } from 'ordering-components-external'
3
+ import { useSession, useOrder, useLanguage, useConfig } from 'ordering-components-external'
4
4
  import HiOutlineLocationMarker from '@meronex/icons/hi/HiOutlineLocationMarker'
5
5
  import {
6
6
  HeroContainer,
@@ -35,17 +35,16 @@ export const OriginalHomeHero = (props) => {
35
35
  const theme = useTheme()
36
36
  const userCustomer = parseInt(window.localStorage.getItem('user-customer'))
37
37
  const windowSize = useWindowSize()
38
- const [orderingTheme] = useOrderingTheme()
39
38
  const [authModalOpen, setAuthModalOpen] = useState(false)
40
39
  const [modalPageToShow, setModalPageToShow] = useState(null)
41
40
  const [newAddressModalOpened, setNewAddressModalOpened] = useState(false)
42
41
 
43
- const isShowLoginAccount = !orderingTheme?.theme?.mobile_view_web?.components?.home?.components?.login_account?.hidden
44
- const bgImg = orderingTheme?.theme?.my_products?.components?.images?.components?.homepage_background?.components?.image
45
- const logo = orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image
46
- const mobileBgImg = orderingTheme?.theme?.my_products?.components?.images?.components?.homepage_mobile_background?.components?.image
47
- const isFullScreen = orderingTheme?.theme?.my_products?.components?.images?.components?.homepage_image_fullscreen
48
- const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
42
+ const isShowLoginAccount = !theme?.mobile_view_web?.components?.home?.components?.login_account?.hidden
43
+ const bgImg = theme?.my_products?.components?.images?.components?.homepage_background?.components?.image
44
+ const logo = theme?.my_products?.components?.images?.components?.logo?.components?.image
45
+ const mobileBgImg = theme?.my_products?.components?.images?.components?.homepage_mobile_background?.components?.image
46
+ const isFullScreen = theme?.my_products?.components?.images?.components?.homepage_image_fullscreen
47
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
49
48
  const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
50
49
  const handleFindBusinesses = () => {
51
50
  if (!orderState?.options?.address?.location) {
@@ -29,6 +29,7 @@ export const CardsContainer = styled.div`
29
29
  export const CardsContainerWrapper = styled.div`
30
30
  margin-bottom: 10px;
31
31
  display: flex;
32
+ overflow: auto hidden;
32
33
  ${({ isBusinessesPage }) => isBusinessesPage && css`
33
34
  overflow: scroll hidden;
34
35
  width: 100%;
@@ -11,7 +11,7 @@ export const Container = styled.div`
11
11
 
12
12
  export const ModalDialog = styled.div`
13
13
  position: relative;
14
- background-color: ${({ isTransparent }) => isTransparent ? 'transparent' : '#FFF'};
14
+ background-color: ${({ isTransparent, theme }) => isTransparent ? 'transparent' : theme?.colors?.backgroundPage};
15
15
  padding: ${({ padding }) => padding || '30px 20px'};
16
16
  width: 100vw;
17
17
  border-radius: 0px;