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.
- package/_bundles/{0.ordering-ui.e9827c5566d8cce0eaa4.js → 0.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +2 -2
- package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/ordering-ui.d1a8d1fbf5b112d5d9a9.js +2 -0
- package/_modules/components/BusinessBasicInformation/index.js +7 -10
- package/_modules/components/OrderDetails/index.js +14 -17
- package/_modules/components/ProductItemAccordion/index.js +4 -5
- package/_modules/components/RenderProductsLayout/SearchProducts/index.js +2 -5
- package/_modules/components/UserFormDetails/index.js +7 -8
- package/_modules/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/components/UserProfileForm/index.js +10 -11
- package/_modules/contexts/ThemeContext/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/index.js +0 -3
- package/_modules/themes/five/src/components/BusinessController/index.js +14 -17
- package/_modules/themes/five/src/components/BusinessController/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessInformation/styles.js +19 -14
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +51 -10
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +32 -25
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -5
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -4
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +11 -12
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +22 -3
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -10
- package/_modules/themes/five/src/components/Cart/index.js +17 -9
- package/_modules/themes/five/src/components/CartPopover/index.js +4 -7
- package/_modules/themes/five/src/components/CartPopover/styles.js +4 -1
- package/_modules/themes/five/src/components/Checkout/index.js +8 -8
- package/_modules/themes/five/src/components/Confirm/styles.js +16 -13
- package/_modules/themes/five/src/components/DatePicker/index.js +2 -1
- package/_modules/themes/five/src/components/Favorite/index.js +4 -5
- package/_modules/themes/five/src/components/Footer/index.js +2 -3
- package/_modules/themes/five/src/components/Header/index.js +5 -8
- package/_modules/themes/five/src/components/HeaderOption/index.js +4 -5
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -10
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/Modal/styles.js +4 -2
- package/_modules/themes/five/src/components/MomentContent/index.js +16 -6
- package/_modules/themes/five/src/components/MomentControl/index.js +44 -34
- package/_modules/themes/five/src/components/MomentControl/styles.js +49 -27
- package/_modules/themes/five/src/components/OrderDetails/index.js +31 -24
- package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -7
- package/_modules/themes/five/src/components/OrderProgress/index.js +5 -1
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +11 -1
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
- package/_modules/themes/five/src/components/OrdersOption/index.js +7 -22
- package/_modules/themes/five/src/components/OrdersOption/styles.js +38 -35
- package/_modules/themes/five/src/components/PageBanner/index.js +79 -58
- package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +2 -1
- package/_modules/themes/five/src/components/ProductForm/styles.js +12 -9
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +0 -3
- package/_modules/themes/five/src/components/ProductOption/styles.js +4 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +8 -9
- package/_modules/themes/five/src/components/SignUpForm/index.js +5 -5
- package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +0 -3
- package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +3 -6
- package/_modules/themes/five/src/components/UserPopover/index.js +3 -6
- package/_modules/themes/five/src/components/UserPopover/styles.js +8 -5
- package/_modules/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/themes/five/src/components/UserProfileForm/index.js +2 -5
- package/_modules/themes/six/src/components/BusinessBasicInformation/index.js +8 -9
- package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -6
- package/package.json +2 -2
- package/src/components/BusinessBasicInformation/index.js +7 -8
- package/src/components/OrderDetails/index.js +14 -16
- package/src/components/ProductItemAccordion/index.js +4 -3
- package/src/components/RenderProductsLayout/SearchProducts/index.js +2 -3
- package/src/components/UserFormDetails/index.js +6 -5
- package/src/components/UserProfileForm/ProfileOptions/index.js +4 -4
- package/src/components/UserProfileForm/index.js +10 -10
- package/src/contexts/ThemeContext/index.js +1 -1
- package/src/themes/five/src/components/AddressForm/index.js +1 -2
- package/src/themes/five/src/components/AddressList/index.js +1 -3
- package/src/themes/five/src/components/BusinessController/index.js +5 -7
- package/src/themes/five/src/components/BusinessController/styles.js +1 -1
- package/src/themes/five/src/components/BusinessInformation/index.js +1 -2
- package/src/themes/five/src/components/BusinessInformation/styles.js +2 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +61 -10
- package/src/themes/five/src/components/BusinessPreorder/styles.js +93 -43
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +10 -3
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +17 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -7
- package/src/themes/five/src/components/Cart/index.js +11 -4
- package/src/themes/five/src/components/CartPopover/index.js +2 -3
- package/src/themes/five/src/components/CartPopover/styles.js +1 -1
- package/src/themes/five/src/components/Checkout/index.js +5 -6
- package/src/themes/five/src/components/Confirm/styles.js +1 -1
- package/src/themes/five/src/components/DatePicker/index.js +1 -0
- package/src/themes/five/src/components/Favorite/index.js +4 -3
- package/src/themes/five/src/components/Footer/index.js +3 -2
- package/src/themes/five/src/components/Header/index.js +4 -5
- package/src/themes/five/src/components/HeaderOption/index.js +4 -3
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -8
- package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -0
- package/src/themes/five/src/components/Modal/styles.js +1 -1
- package/src/themes/five/src/components/MomentContent/index.js +17 -8
- package/src/themes/five/src/components/MomentControl/index.js +83 -45
- package/src/themes/five/src/components/MomentControl/styles.js +137 -34
- package/src/themes/five/src/components/MyOrders/index.js +1 -1
- package/src/themes/five/src/components/OrderDetails/index.js +50 -21
- package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -6
- package/src/themes/five/src/components/OrderProgress/index.js +5 -1
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +13 -1
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
- package/src/themes/five/src/components/OrdersOption/index.js +3 -17
- package/src/themes/five/src/components/OrdersOption/styles.js +3 -4
- package/src/themes/five/src/components/PageBanner/index.js +65 -51
- package/src/themes/five/src/components/PhoneAutocomplete/index.js +1 -0
- package/src/themes/five/src/components/ProductForm/styles.js +1 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +1 -2
- package/src/themes/five/src/components/ProductOption/styles.js +1 -1
- package/src/themes/five/src/components/RenderProductsLayout/index.js +9 -6
- package/src/themes/five/src/components/SignUpForm/index.js +6 -6
- package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +1 -2
- package/src/themes/five/src/components/UserDetails/index.js +1 -1
- package/src/themes/five/src/components/UserDetails/styles.js +3 -0
- package/src/themes/five/src/components/UserFormDetails/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/styles.js +1 -1
- package/src/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -3
- package/src/themes/five/src/components/UserProfileForm/index.js +2 -4
- package/src/themes/six/src/components/BusinessBasicInformation/index.js +8 -7
- package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +2 -3
- package/template/app.js +15 -10
- package/template/components/HelmetTags/index.js +3 -2
- package/template/pages/AddressList/index.js +4 -3
- package/template/pages/BusinessProductsList/index.js +5 -4
- package/template/pages/BusinessesList/index.js +6 -6
- package/template/pages/Checkout/index.js +6 -4
- package/template/pages/Home/index.js +4 -2
- package/template/pages/MessagesList/index.js +5 -4
- package/template/pages/MyOrders/index.js +6 -5
- package/template/pages/OrderDetails/index.js +4 -3
- package/_bundles/ordering-ui.e9827c5566d8cce0eaa4.js +0 -2
- package/template/components/OrderingThemeUpdated/index.js +0 -41
- /package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js.LICENSE.txt} +0 -0
- /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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
|
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 =
|
|
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
|
-
) : (
|
|
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 ||
|
|
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 ||
|
|
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: ${(
|
|
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
|
)}
|
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
230
|
-
|
|
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?.
|
|
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 ||
|
|
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 ||
|
|
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
|
-
) :
|
|
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
|
|
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 =
|
|
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: [
|
|
@@ -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 =
|
|
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])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { useLanguage, useOrder
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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 =
|
|
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 :
|
|
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 :
|
|
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
|
|
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
|
|
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,
|
|
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 = !
|
|
44
|
-
const bgImg =
|
|
45
|
-
const logo =
|
|
46
|
-
const mobileBgImg =
|
|
47
|
-
const isFullScreen =
|
|
48
|
-
const isChew =
|
|
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) {
|
|
@@ -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' :
|
|
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;
|