ordering-ui-external 2.1.3 → 2.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.
- package/_bundles/{0.ordering-ui.7ab84608232e3f5c3b4b.js → 0.ordering-ui.bdd6b221a4d558a752fc.js} +1 -1
- package/_bundles/{1.ordering-ui.7ab84608232e3f5c3b4b.js → 1.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{2.ordering-ui.7ab84608232e3f5c3b4b.js → 2.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{4.ordering-ui.7ab84608232e3f5c3b4b.js → 4.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{5.ordering-ui.7ab84608232e3f5c3b4b.js → 5.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{6.ordering-ui.7ab84608232e3f5c3b4b.js → 6.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{7.ordering-ui.7ab84608232e3f5c3b4b.js → 7.ordering-ui.bdd6b221a4d558a752fc.js} +1 -1
- package/_bundles/{7.ordering-ui.7ab84608232e3f5c3b4b.js.LICENSE.txt → 7.ordering-ui.bdd6b221a4d558a752fc.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.7ab84608232e3f5c3b4b.js → 8.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{9.ordering-ui.7ab84608232e3f5c3b4b.js → 9.ordering-ui.bdd6b221a4d558a752fc.js} +0 -0
- package/_bundles/{ordering-ui.7ab84608232e3f5c3b4b.js → ordering-ui.bdd6b221a4d558a752fc.js} +2 -2
- package/_bundles/{ordering-ui.7ab84608232e3f5c3b4b.js.LICENSE.txt → ordering-ui.bdd6b221a4d558a752fc.js.LICENSE.txt} +0 -0
- package/_modules/hooks/useIntersectionObserver.js +6 -5
- package/_modules/styles/Toast/index.js +4 -3
- package/_modules/themes/five/src/components/AddressDetails/index.js +1 -1
- package/_modules/themes/five/src/components/AddressDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessListingSearch/Accordion/index.js +43 -0
- package/_modules/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +16 -4
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +26 -13
- package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +43 -41
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +23 -4
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +38 -22
- package/_modules/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessProductsList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +10 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +23 -17
- package/_modules/themes/five/src/components/Cart/styles.js +1 -1
- package/_modules/themes/five/src/components/Checkout/index.js +24 -19
- package/_modules/themes/five/src/components/Checkout/styles.js +1 -1
- package/_modules/themes/five/src/components/DriverTips/index.js +6 -2
- package/_modules/themes/five/src/components/Header/styles.js +2 -2
- package/_modules/themes/five/src/components/Help/index.js +1 -1
- package/_modules/themes/five/src/components/LastOrders/index.js +3 -8
- package/_modules/themes/five/src/components/MessagesListing/index.js +2 -2
- package/_modules/themes/five/src/components/MessagesListing/styles.js +1 -1
- package/_modules/themes/five/src/components/MultiCheckout/index.js +1 -1
- package/_modules/themes/five/src/components/MyOrders/index.js +1 -3
- package/_modules/themes/five/src/components/NotFoundSource/index.js +3 -11
- package/_modules/themes/five/src/components/NotFoundSource/styles.js +2 -2
- package/_modules/themes/five/src/components/OrderContextUI/index.js +2 -1
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +14 -11
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +1 -1
- package/_modules/themes/five/src/components/ServiceForm/index.js +16 -11
- package/_modules/themes/five/src/components/ServiceForm/styles.js +16 -5
- 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 +1 -1
- package/_modules/themes/five/src/components/UserPopover/index.js +6 -0
- package/_modules/themes/five/src/components/UserProfileForm/index.js +0 -2
- package/_modules/themes/five/src/components/UserProfileForm/styles.js +1 -1
- package/_modules/themes/five/src/components/WalletTransactionItem/index.js +4 -2
- package/_modules/themes/five/src/components/Wallets/index.js +4 -4
- package/_modules/themes/five/src/components/Wallets/styles.js +33 -12
- package/_modules/themes/five/src/styles/Buttons/index.js +3 -1
- package/_modules/themes/pwa/src/components/MomentControl/index.js +7 -9
- package/_modules/utils/index.js +28 -2
- package/package.json +2 -2
- package/src/hooks/useIntersectionObserver.js +7 -6
- package/src/styles/Toast/index.js +4 -2
- package/src/themes/five/src/components/AddressDetails/index.js +1 -1
- package/src/themes/five/src/components/AddressDetails/styles.js +4 -1
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +3 -1
- package/src/themes/five/src/components/BusinessItemAccordion/styles.js +9 -3
- package/src/themes/five/src/components/BusinessListingSearch/Accordion/index.js +23 -0
- package/src/themes/five/src/components/BusinessListingSearch/MaxSectionItem/index.js +28 -17
- package/src/themes/five/src/components/BusinessListingSearch/index.js +65 -66
- package/src/themes/five/src/components/BusinessListingSearch/styles.js +21 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +24 -0
- package/src/themes/five/src/components/BusinessPreorder/styles.js +11 -1
- package/src/themes/five/src/components/BusinessProductsList/layouts/groceries/styles.js +7 -3
- package/src/themes/five/src/components/BusinessProductsList/styles.js +3 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +11 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +11 -1
- package/src/themes/five/src/components/Cart/styles.js +3 -1
- package/src/themes/five/src/components/Checkout/index.js +49 -62
- package/src/themes/five/src/components/Checkout/styles.js +3 -1
- package/src/themes/five/src/components/DriverTips/index.js +7 -2
- package/src/themes/five/src/components/Header/styles.js +4 -2
- package/src/themes/five/src/components/Help/index.js +0 -1
- package/src/themes/five/src/components/LastOrders/index.js +25 -28
- package/src/themes/five/src/components/MessagesListing/index.js +2 -2
- package/src/themes/five/src/components/MessagesListing/styles.js +3 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +13 -13
- package/src/themes/five/src/components/MyOrders/index.js +0 -3
- package/src/themes/five/src/components/NotFoundSource/index.js +5 -10
- package/src/themes/five/src/components/NotFoundSource/styles.js +7 -2
- package/src/themes/five/src/components/OrderContextUI/index.js +1 -1
- package/src/themes/five/src/components/OrderContextUI/styles.js +4 -2
- package/src/themes/five/src/components/PageBanner/styles.js +1 -0
- package/src/themes/five/src/components/ReviewProduct/styles.js +3 -3
- package/src/themes/five/src/components/ServiceForm/index.js +20 -14
- package/src/themes/five/src/components/ServiceForm/styles.js +11 -3
- package/src/themes/five/src/components/UserDetails/index.js +2 -2
- package/src/themes/five/src/components/UserDetails/styles.js +3 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +0 -1
- package/src/themes/five/src/components/UserPopover/index.js +2 -0
- package/src/themes/five/src/components/UserProfileForm/index.js +0 -3
- package/src/themes/five/src/components/UserProfileForm/styles.js +0 -5
- package/src/themes/five/src/components/WalletTransactionItem/index.js +4 -1
- package/src/themes/five/src/components/Wallets/index.js +101 -95
- package/src/themes/five/src/components/Wallets/styles.js +37 -17
- package/src/themes/five/src/styles/Buttons/index.js +4 -0
- package/src/themes/pwa/src/components/MomentControl/index.js +6 -11
- package/src/utils/index.js +38 -12
- package/template/pages/Home/index.js +3 -0
|
@@ -16,8 +16,27 @@ export const BusinessListingSearchContainer = styled.div`
|
|
|
16
16
|
}
|
|
17
17
|
`
|
|
18
18
|
|
|
19
|
+
export const Title = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
margin: 20px 0;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
|
|
26
|
+
h3 {
|
|
27
|
+
margin: 0 10px 0 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rotate {
|
|
31
|
+
transform: rotate(180deg);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.accordion__icon {
|
|
35
|
+
transition: transform 0.6s ease;
|
|
36
|
+
}
|
|
37
|
+
`
|
|
38
|
+
|
|
19
39
|
export const FiltersContainer = styled.div`
|
|
20
|
-
|
|
21
40
|
flex-direction: column;
|
|
22
41
|
@media (min-width: 993px){
|
|
23
42
|
flex-direction: row;
|
|
@@ -32,7 +51,7 @@ export const Filters = styled.div`
|
|
|
32
51
|
@media (min-width: 993px){
|
|
33
52
|
width: 25%;
|
|
34
53
|
max-width: 25%;
|
|
35
|
-
margin-right:
|
|
54
|
+
margin-right: 70px;
|
|
36
55
|
}
|
|
37
56
|
`
|
|
38
57
|
|
|
@@ -93,6 +93,28 @@ const BusinessPreorderUI = (props) => {
|
|
|
93
93
|
setIsEnabled(menu.schedule[day].enabled || false)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
const getMomentTime = (time) => {
|
|
97
|
+
const _moment = moment(`${moment(dateSelected).format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm').toDate()
|
|
98
|
+
return _moment
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const isBusyTime = (professional, selectedMoment) => {
|
|
102
|
+
if (!selectedMoment) return false
|
|
103
|
+
const startDay = moment(selectedMoment).utc().format('d')
|
|
104
|
+
const isStartScheduleEnabled = professional?.schedule?.[startDay]?.enabled
|
|
105
|
+
if (!isStartScheduleEnabled) return true
|
|
106
|
+
|
|
107
|
+
if (professional?.busy_times?.length === 0) return false
|
|
108
|
+
|
|
109
|
+
const busyTimes = professional?.busy_times
|
|
110
|
+
|
|
111
|
+
const valid = busyTimes.some(item => {
|
|
112
|
+
return (moment.utc(item?.start).local().valueOf() <= moment(selectedMoment).valueOf() &&
|
|
113
|
+
moment(selectedMoment).valueOf() < moment.utc(item?.end).local().valueOf())
|
|
114
|
+
})
|
|
115
|
+
return valid
|
|
116
|
+
}
|
|
117
|
+
|
|
96
118
|
const getTimeList = (curdate, menu) => {
|
|
97
119
|
validateSelectedDate(curdate, menu)
|
|
98
120
|
const dateParts = curdate.split('-')
|
|
@@ -208,6 +230,8 @@ const BusinessPreorderUI = (props) => {
|
|
|
208
230
|
active={timeSelected === time.value}
|
|
209
231
|
onClick={() => handleChangeTime(time.value)}
|
|
210
232
|
isDisabled={isDisabled}
|
|
233
|
+
isProfessional={isProfessional}
|
|
234
|
+
busyTime={isProfessional && isBusyTime(business, getMomentTime(time.value))}
|
|
211
235
|
>
|
|
212
236
|
<span>{time.text}</span>
|
|
213
237
|
</TimeItem>
|
|
@@ -155,7 +155,12 @@ export const TimeItem = styled.div`
|
|
|
155
155
|
display: flex;
|
|
156
156
|
justify-content: center;
|
|
157
157
|
align-items: center;
|
|
158
|
-
|
|
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
|
+
`}
|
|
159
164
|
border-radius: 7.6px;
|
|
160
165
|
padding: 5px 15px;
|
|
161
166
|
margin: 12px;
|
|
@@ -172,6 +177,11 @@ export const TimeItem = styled.div`
|
|
|
172
177
|
${({ isDisabled }) => isDisabled && css`
|
|
173
178
|
pointer-events: none;
|
|
174
179
|
`}
|
|
180
|
+
|
|
181
|
+
${({ busyTime }) => busyTime && css`
|
|
182
|
+
background: ${props => props.theme.colors.gray200};
|
|
183
|
+
color: ${props => props.theme.colors.lightGray};
|
|
184
|
+
`}
|
|
175
185
|
|
|
176
186
|
span {
|
|
177
187
|
font-size: 14px;
|
|
@@ -47,10 +47,12 @@ export const WrapAllCategories = styled.div`
|
|
|
47
47
|
white-space: pre;
|
|
48
48
|
}
|
|
49
49
|
span {
|
|
50
|
-
color: ${props => props.theme.colors.primary}
|
|
51
|
-
text-decoration: underline;
|
|
50
|
+
color: ${props => props.theme.colors.primary};=
|
|
52
51
|
margin-left: 10px;
|
|
53
52
|
cursor: pointer;
|
|
53
|
+
&:hover {
|
|
54
|
+
text-decoration: underline;
|
|
55
|
+
}
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -150,11 +152,13 @@ export const CategoryDescripion = styled.div`
|
|
|
150
152
|
}
|
|
151
153
|
span {
|
|
152
154
|
color: ${props => props.theme.colors.primary};
|
|
153
|
-
text-decoration: underline;
|
|
154
155
|
margin-left: 10px;
|
|
155
156
|
cursor: pointer;
|
|
156
157
|
white-space: nowrap;
|
|
157
158
|
overflow: visible;
|
|
159
|
+
&:hover {
|
|
160
|
+
text-decoration: underline;
|
|
161
|
+
}
|
|
158
162
|
}
|
|
159
163
|
`
|
|
160
164
|
|
|
@@ -80,10 +80,12 @@ export const CategoryDescription = styled.div`
|
|
|
80
80
|
}
|
|
81
81
|
span {
|
|
82
82
|
color: ${props => props.theme.colors.primary};
|
|
83
|
-
text-decoration: underline;
|
|
84
83
|
margin-left: 10px;
|
|
85
84
|
cursor: pointer;
|
|
86
85
|
white-space: nowrap;
|
|
86
|
+
&:hover {
|
|
87
|
+
text-decoration: underline;
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
`
|
|
89
91
|
|
|
@@ -243,6 +243,16 @@ const BusinessProductsListingUI = (props) => {
|
|
|
243
243
|
events.emit('get_current_view')
|
|
244
244
|
}, [])
|
|
245
245
|
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
const handleClickedBannerProduct = () => {
|
|
248
|
+
handleUpdateInitialRender(true)
|
|
249
|
+
}
|
|
250
|
+
events.on('product_banner_clicked', handleClickedBannerProduct)
|
|
251
|
+
return () => {
|
|
252
|
+
events.off('product_banner_clicked', handleClickedBannerProduct)
|
|
253
|
+
}
|
|
254
|
+
}, [])
|
|
255
|
+
|
|
246
256
|
useEffect(() => {
|
|
247
257
|
if (loading) return
|
|
248
258
|
if (openProduct) {
|
|
@@ -442,7 +452,7 @@ const BusinessProductsListingUI = (props) => {
|
|
|
442
452
|
disableOverflowX
|
|
443
453
|
>
|
|
444
454
|
|
|
445
|
-
{productModal.loading && !productModal.error && (
|
|
455
|
+
{productModal.loading && !productModal.error && !productModal.product && (
|
|
446
456
|
<ProductLoading>
|
|
447
457
|
<SkeletonItem>
|
|
448
458
|
<Skeleton height={45} count={props.useKioskApp ? 12 : 8} />
|
package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js
CHANGED
|
@@ -47,6 +47,7 @@ import { AutoScroll } from '../../../AutoScroll'
|
|
|
47
47
|
import { CitiesControl } from '../../../CitiesControl'
|
|
48
48
|
import { OrderContextUI } from '../../../OrderContextUI'
|
|
49
49
|
import { OrdersSection } from './OrdersSection'
|
|
50
|
+
import { getCateringValues } from '../../../../../../../utils'
|
|
50
51
|
|
|
51
52
|
const PIXELS_TO_SCROLL = 300
|
|
52
53
|
|
|
@@ -97,6 +98,13 @@ const BusinessesListingUI = (props) => {
|
|
|
97
98
|
const businessesIds = businessesList.businesses &&
|
|
98
99
|
businessesList.businesses?.map(business => business.id)
|
|
99
100
|
const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
101
|
+
const cateringTypeString = orderState?.options?.type === 7
|
|
102
|
+
? 'catering_delivery'
|
|
103
|
+
: orderState?.options?.type === 8
|
|
104
|
+
? 'catering_pickup'
|
|
105
|
+
: null
|
|
106
|
+
|
|
107
|
+
const cateringValues = preorderBusiness?.configs && getCateringValues(cateringTypeString, preorderBusiness?.configs)
|
|
100
108
|
|
|
101
109
|
const handleScroll = useCallback(() => {
|
|
102
110
|
const innerHeightScrolltop = window.innerHeight + document.documentElement?.scrollTop + PIXELS_TO_SCROLL
|
|
@@ -210,7 +218,7 @@ const BusinessesListingUI = (props) => {
|
|
|
210
218
|
{(windowSize.width < 576 || (configs?.business_listing_hide_image?.value !== '1' && !isChew)) && (
|
|
211
219
|
<BusinessBanner>
|
|
212
220
|
{windowSize.width < 576 && (
|
|
213
|
-
<OrderContextUI isBusinessList />
|
|
221
|
+
<OrderContextUI isBusinessList hideHero={!hideHero} />
|
|
214
222
|
)}
|
|
215
223
|
{(configs?.business_listing_hide_image?.value !== '1' && !isChew) && !hideHero && (
|
|
216
224
|
<BusinessHeroImg
|
|
@@ -415,6 +423,8 @@ const BusinessesListingUI = (props) => {
|
|
|
415
423
|
business={preorderBusiness}
|
|
416
424
|
handleClick={handleBusinessClick}
|
|
417
425
|
showButton
|
|
426
|
+
cateringPreorder={!!cateringTypeString}
|
|
427
|
+
{...cateringValues}
|
|
418
428
|
/>
|
|
419
429
|
</Modal>
|
|
420
430
|
<Modal
|
|
@@ -157,6 +157,12 @@ const CheckoutUI = (props) => {
|
|
|
157
157
|
}
|
|
158
158
|
})
|
|
159
159
|
|
|
160
|
+
const hideBusinessAddress = theme?.checkout?.components?.business?.components?.address?.hidden
|
|
161
|
+
const hideBusinessDetails = theme?.checkout?.components?.business?.hidden
|
|
162
|
+
const hideBusinessMap = theme?.checkout?.components?.business?.components?.map?.hidden
|
|
163
|
+
const hideCustomerDetails = theme?.checkout?.components?.customer?.hidden
|
|
164
|
+
const driverTipsField = !cartState.loading && cart && cart?.business_id && options.type === 1 && cart?.status !== 2 && validationFields?.fields?.checkout?.driver_tip?.enabled && driverTipsOptions.length > 0 && !useKioskApp
|
|
165
|
+
|
|
160
166
|
const handlePlaceOrder = () => {
|
|
161
167
|
if (!userErrors.length && !requiredFields?.length) {
|
|
162
168
|
const body = {}
|
|
@@ -289,7 +295,7 @@ const CheckoutUI = (props) => {
|
|
|
289
295
|
</h1>
|
|
290
296
|
</WarningMessage>
|
|
291
297
|
)}
|
|
292
|
-
<h2 className='checkout-title'>{t('
|
|
298
|
+
<h2 className='checkout-title'>{t('CHECKOUT', 'Checkout')}</h2>
|
|
293
299
|
|
|
294
300
|
{!useKioskApp ? (
|
|
295
301
|
<>
|
|
@@ -452,38 +458,31 @@ const CheckoutUI = (props) => {
|
|
|
452
458
|
/>
|
|
453
459
|
</WalletPaymentOptionContainer>
|
|
454
460
|
)}
|
|
455
|
-
|
|
456
|
-
{
|
|
457
|
-
isMultiDriverTips &&
|
|
458
|
-
!cartState.loading &&
|
|
459
|
-
cart &&
|
|
460
|
-
cart?.business_id &&
|
|
461
|
-
options.type === 1 &&
|
|
462
|
-
cart?.status !== 2 &&
|
|
463
|
-
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
464
|
-
driverTipsOptions.length > 0 &&
|
|
465
|
-
!useKioskApp &&
|
|
466
|
-
(
|
|
467
|
-
<DriverTipContainer>
|
|
468
|
-
<h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
|
|
469
|
-
<p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
|
|
470
|
-
<DriverTips
|
|
471
|
-
businessId={cart?.business_id}
|
|
472
|
-
driverTipsOptions={driverTipsOptions}
|
|
473
|
-
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
474
|
-
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
475
|
-
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
476
|
-
? cart?.driver_tip
|
|
477
|
-
: cart?.driver_tip_rate}
|
|
478
|
-
cart={cart}
|
|
479
|
-
useOrderContext
|
|
480
|
-
/>
|
|
481
|
-
</DriverTipContainer>
|
|
482
|
-
)
|
|
483
|
-
}
|
|
484
461
|
</WrapperLeftContent>
|
|
485
462
|
</WrapperLeftContainer>
|
|
486
463
|
<WrapperRightContainer>
|
|
464
|
+
|
|
465
|
+
{
|
|
466
|
+
!!(!isMultiDriverTips && driverTipsField) &&
|
|
467
|
+
<>
|
|
468
|
+
<DriverTipContainer>
|
|
469
|
+
<h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
|
|
470
|
+
<p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
|
|
471
|
+
<DriverTips
|
|
472
|
+
businessId={cart?.business_id}
|
|
473
|
+
driverTipsOptions={driverTipsOptions}
|
|
474
|
+
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
475
|
+
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
476
|
+
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
477
|
+
? cart?.driver_tip
|
|
478
|
+
: cart?.driver_tip_rate}
|
|
479
|
+
cart={cart}
|
|
480
|
+
useOrderContext
|
|
481
|
+
/>
|
|
482
|
+
</DriverTipContainer>
|
|
483
|
+
<DriverTipDivider />
|
|
484
|
+
</>
|
|
485
|
+
}
|
|
487
486
|
{!cartState.loading && placeSpotsEnabled && cart?.business_id && (
|
|
488
487
|
<SelectSpotContainer>
|
|
489
488
|
<PlaceSpot
|
|
@@ -497,38 +496,6 @@ const CheckoutUI = (props) => {
|
|
|
497
496
|
/>
|
|
498
497
|
</SelectSpotContainer>
|
|
499
498
|
)}
|
|
500
|
-
{
|
|
501
|
-
!isMultiDriverTips &&
|
|
502
|
-
!cartState.loading &&
|
|
503
|
-
cart &&
|
|
504
|
-
cart?.business_id &&
|
|
505
|
-
options.type === 1 &&
|
|
506
|
-
cart?.status !== 2 &&
|
|
507
|
-
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
508
|
-
driverTipsOptions.length > 0 &&
|
|
509
|
-
!useKioskApp &&
|
|
510
|
-
(
|
|
511
|
-
<>
|
|
512
|
-
<DriverTipContainer>
|
|
513
|
-
<h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
|
|
514
|
-
<p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
|
|
515
|
-
<DriverTips
|
|
516
|
-
businessId={cart?.business_id}
|
|
517
|
-
driverTipsOptions={driverTipsOptions}
|
|
518
|
-
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
519
|
-
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
520
|
-
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
521
|
-
? cart?.driver_tip
|
|
522
|
-
: cart?.driver_tip_rate}
|
|
523
|
-
cart={cart}
|
|
524
|
-
useOrderContext
|
|
525
|
-
/>
|
|
526
|
-
</DriverTipContainer>
|
|
527
|
-
<DriverTipDivider />
|
|
528
|
-
</>
|
|
529
|
-
)
|
|
530
|
-
}
|
|
531
|
-
|
|
532
499
|
{!cartState.loading && cart && (
|
|
533
500
|
<CartContainer>
|
|
534
501
|
<CartHeader>
|
|
@@ -546,6 +513,26 @@ const CheckoutUI = (props) => {
|
|
|
546
513
|
/>
|
|
547
514
|
</CartContainer>
|
|
548
515
|
)}
|
|
516
|
+
{
|
|
517
|
+
!!(isMultiDriverTips && driverTipsField) &&
|
|
518
|
+
(
|
|
519
|
+
<DriverTipContainer>
|
|
520
|
+
<h1>{t('DRIVER_TIPS', 'Driver Tips')}</h1>
|
|
521
|
+
<p>{t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')}</p>
|
|
522
|
+
<DriverTips
|
|
523
|
+
businessId={cart?.business_id}
|
|
524
|
+
driverTipsOptions={driverTipsOptions}
|
|
525
|
+
isFixedPrice={parseInt(configs?.driver_tip_type?.value, 10) === 1}
|
|
526
|
+
isDriverTipUseCustom={!!parseInt(configs?.driver_tip_use_custom?.value, 10)}
|
|
527
|
+
driverTip={parseInt(configs?.driver_tip_type?.value, 10) === 1
|
|
528
|
+
? cart?.driver_tip
|
|
529
|
+
: cart?.driver_tip_rate}
|
|
530
|
+
cart={cart}
|
|
531
|
+
useOrderContext
|
|
532
|
+
/>
|
|
533
|
+
</DriverTipContainer>
|
|
534
|
+
)
|
|
535
|
+
}
|
|
549
536
|
|
|
550
537
|
{windowSize.width >= 576 && !cartState.loading && cart && cart?.status !== 2 && (
|
|
551
538
|
<WrapperPlaceOrderButton>
|
|
@@ -258,9 +258,11 @@ export const CartHeader = styled.div`
|
|
|
258
258
|
span {
|
|
259
259
|
font-size: 13px;
|
|
260
260
|
color: ${props => props.theme.colors.primary};
|
|
261
|
-
text-decoration: underline;
|
|
262
261
|
cursor: pointer;
|
|
263
262
|
user-select: none;
|
|
263
|
+
&:hover {
|
|
264
|
+
text-decoration: underline;
|
|
265
|
+
}
|
|
264
266
|
}
|
|
265
267
|
|
|
266
268
|
h1, span {
|
|
@@ -18,6 +18,7 @@ const DriverTipsUI = (props) => {
|
|
|
18
18
|
driverTip,
|
|
19
19
|
driverTipsOptions,
|
|
20
20
|
cart,
|
|
21
|
+
carts,
|
|
21
22
|
isDriverTipUseCustom,
|
|
22
23
|
handlerChangeOption
|
|
23
24
|
} = props
|
|
@@ -40,6 +41,10 @@ const DriverTipsUI = (props) => {
|
|
|
40
41
|
? `${configs?.format_number_currency?.value}0`
|
|
41
42
|
: `0${configs?.format_number_currency?.value}`
|
|
42
43
|
|
|
44
|
+
const multiCartTipsAmmout = carts?.reduce((total, cart) => {
|
|
45
|
+
return total + parseFloat(cart?.driver_tip || 0)
|
|
46
|
+
}, 0)
|
|
47
|
+
|
|
43
48
|
return (
|
|
44
49
|
<DriverTipContainer id='driver-tip-container'>
|
|
45
50
|
<>
|
|
@@ -56,7 +61,7 @@ const DriverTipsUI = (props) => {
|
|
|
56
61
|
{`${isFixedPriceType ? parsePrice(option) : `${option}%`}`}
|
|
57
62
|
</TipCard>
|
|
58
63
|
))}
|
|
59
|
-
{
|
|
64
|
+
{isDriverTipUseCustom && (
|
|
60
65
|
<TipCard
|
|
61
66
|
className={`${customTip ? 'active' : ''}`}
|
|
62
67
|
onClick={() => setCustomTip(true)}
|
|
@@ -90,7 +95,7 @@ const DriverTipsUI = (props) => {
|
|
|
90
95
|
{currentTip && (
|
|
91
96
|
<DriverTipMessage>
|
|
92
97
|
{t('CURRENT_DRIVER_TIP_AMOUNT', 'Current driver tip amount')}{!isFixedPriceType &&
|
|
93
|
-
` (${driverTip}%)`}: {isFixedPriceType ?
|
|
98
|
+
` (${driverTip}%)`}: {parsePrice(isMulti ? multiCartTipsAmmout : isFixedPriceType ? driverTip : cart?.driver_tip)}
|
|
94
99
|
</DriverTipMessage>
|
|
95
100
|
)}
|
|
96
101
|
</WrapperTips>
|
|
@@ -100,6 +100,8 @@ export const RightHeader = styled.div`
|
|
|
100
100
|
export const Menu = styled.div`
|
|
101
101
|
display: flex;
|
|
102
102
|
align-items: center;
|
|
103
|
+
margin-right: 10px;
|
|
104
|
+
|
|
103
105
|
#select-input {
|
|
104
106
|
border-radius: 7.6px;
|
|
105
107
|
#list {
|
|
@@ -428,7 +430,7 @@ export const LanguageSelectorWrapper = styled(InputGroup)`
|
|
|
428
430
|
}
|
|
429
431
|
}
|
|
430
432
|
#select-input {
|
|
431
|
-
margin:
|
|
433
|
+
margin-left: 5px;
|
|
432
434
|
}
|
|
433
435
|
`
|
|
434
436
|
|
|
@@ -453,7 +455,7 @@ export const LeftSide = styled.div`
|
|
|
453
455
|
width: 100%;
|
|
454
456
|
@media (min-width: 769px){
|
|
455
457
|
flex-direction: ${({ theme }) =>
|
|
456
|
-
|
|
458
|
+
theme?.header?.components?.logo?.components?.layout?.position === 'center' ? 'row-reverse' : 'row'};
|
|
457
459
|
width: 60%;
|
|
458
460
|
}
|
|
459
461
|
`
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
OrderInfoBlock,
|
|
14
14
|
BusinessHeader
|
|
15
15
|
} from './styles'
|
|
16
|
-
import { NotFoundSource } from '../NotFoundSource'
|
|
17
16
|
|
|
18
17
|
export const LastOrdersUI = (props) => {
|
|
19
18
|
const {
|
|
@@ -39,33 +38,31 @@ export const LastOrdersUI = (props) => {
|
|
|
39
38
|
</React.Fragment>))}
|
|
40
39
|
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
41
40
|
<BeforeComponent key={i} {...props} />))}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{order?.delivery_datetime_utc
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)}
|
|
68
|
-
</LastOrdersContainer>
|
|
41
|
+
{!orderList?.loading && orderList?.orders?.length > 0 && (
|
|
42
|
+
<>
|
|
43
|
+
<h2>{t('LAST_ORDER', 'Last order')}</h2>
|
|
44
|
+
<LastOrdersContainer>
|
|
45
|
+
{orderList?.loading && <Skeleton height={150} />}
|
|
46
|
+
{!orderList?.loading && orderList?.orders?.length > 0 && orderList?.orders.map((order, i) => (
|
|
47
|
+
<BusinessHeader key={i} bgimage={optimizeImage(order?.business?.header || theme.images?.dummies?.businessLogo, 'h_400,c_limit')}>
|
|
48
|
+
<OrderInfoBlock onClick={() => handleClickOrder(order?.uuid)}>
|
|
49
|
+
{order?.business?.name && (
|
|
50
|
+
<h4>{order?.business?.name}</h4>
|
|
51
|
+
)}
|
|
52
|
+
{(order?.delivery_datetime_utc || order?.delivery_datetime) && (
|
|
53
|
+
<p>
|
|
54
|
+
<span>{t('TUTORIAL_ORDER_COMPLETED', 'Order Completed')} {('ON', 'on')} </span>
|
|
55
|
+
{order?.delivery_datetime_utc
|
|
56
|
+
? parseDate(order?.delivery_datetime_utc)
|
|
57
|
+
: parseDate(order?.delivery_datetime, { utc: false })}
|
|
58
|
+
</p>
|
|
59
|
+
)}
|
|
60
|
+
</OrderInfoBlock>
|
|
61
|
+
</BusinessHeader>
|
|
62
|
+
))}
|
|
63
|
+
</LastOrdersContainer>
|
|
64
|
+
</>
|
|
65
|
+
)}
|
|
69
66
|
{props.afterComponents?.map((AfterComponent, i) => (
|
|
70
67
|
<AfterComponent key={i} {...props} />))}
|
|
71
68
|
{props.afterElements?.map((AfterElement, i) => (
|
|
@@ -4,8 +4,9 @@ import { useLanguage, useUtils, useEvent, OrderList as OrderListController, Orde
|
|
|
4
4
|
import { useTheme } from 'styled-components'
|
|
5
5
|
import Skeleton from 'react-loading-skeleton'
|
|
6
6
|
import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
7
|
-
import { NotFoundSource } from '../../../../../components/NotFoundSource'
|
|
8
7
|
import { getOrderStatus } from '../../../../../utils'
|
|
8
|
+
import { Messages } from '../Messages'
|
|
9
|
+
import { NotFoundSource } from '../NotFoundSource'
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
MessagesListingContainer,
|
|
@@ -33,7 +34,6 @@ import {
|
|
|
33
34
|
DriverText,
|
|
34
35
|
NotFoundSourceWrapper
|
|
35
36
|
} from './styles'
|
|
36
|
-
import { Messages } from '../Messages'
|
|
37
37
|
|
|
38
38
|
const OrdersListingUI = (props) => {
|
|
39
39
|
const {
|
|
@@ -171,7 +171,7 @@ const MultiCheckoutUI = (props) => {
|
|
|
171
171
|
<WrapperLeftContainer>
|
|
172
172
|
<WrapperLeftContent>
|
|
173
173
|
<ArrowLeft className='back-arrow' onClick={() => history.goBack()} />
|
|
174
|
-
<h2 className='checkout-title'>{t('
|
|
174
|
+
<h2 className='checkout-title'>{t('CHECKOUT', 'Checkout')}</h2>
|
|
175
175
|
|
|
176
176
|
<AddressDetails
|
|
177
177
|
isMultiCheckout
|
|
@@ -263,20 +263,20 @@ const MultiCheckoutUI = (props) => {
|
|
|
263
263
|
<MultiCartPriceContainer totalFeeEnabled={totalFeeEnabled}>
|
|
264
264
|
{!!totalCartsFee &&
|
|
265
265
|
configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1' &&
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
(
|
|
267
|
+
<span>
|
|
268
|
+
<p>{t('TOTAL_DELIVERY_FEE', 'Total delivery fee')}</p>
|
|
269
|
+
<p>{parsePrice(totalCartsFee)}</p>
|
|
270
|
+
</span>
|
|
271
|
+
)}
|
|
272
272
|
{openCarts.reduce((sum, cart) => sum + cart?.driver_tip, 0) > 0 &&
|
|
273
273
|
configs?.multi_business_checkout_show_combined_driver_tip?.value === '1' &&
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
274
|
+
(
|
|
275
|
+
<span>
|
|
276
|
+
<p>{t('DRIVER_TIP', 'Driver tip')}</p>
|
|
277
|
+
<p>{parsePrice(openCarts.reduce((sum, cart) => sum + cart?.driver_tip, 0))}</p>
|
|
278
|
+
</span>
|
|
279
|
+
)}
|
|
280
280
|
<div>
|
|
281
281
|
<h4>{t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}</h4>
|
|
282
282
|
<h4>{parsePrice(totalCartsPrice)}</h4>
|
|
@@ -54,9 +54,6 @@ export const MyOrders = (props) => {
|
|
|
54
54
|
{hideOrders && !allEmpty && (
|
|
55
55
|
<h2>{t('PREVIOUSLY_ORDERED', 'Previously ordered')}</h2>
|
|
56
56
|
)}
|
|
57
|
-
{!hideOrders && !props.hideOptions && (
|
|
58
|
-
<ProfileOptions value='orders' />
|
|
59
|
-
)}
|
|
60
57
|
<Container hideOrders={hideOrders}>
|
|
61
58
|
{!hideOrders && (
|
|
62
59
|
<h1>{layout === 'appointments' ? t('MY_APPOINTMENTS', 'My appointments') : t('MY_ORDERS', 'My orders')}</h1>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { useTheme } from 'styled-components'
|
|
3
2
|
import { Button } from '../../styles/Buttons'
|
|
3
|
+
import FdPageSearch from '@meronex/icons/fd/FdPageSearch'
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
NotFound,
|
|
@@ -17,9 +17,6 @@ export const NotFoundSource = (props) => {
|
|
|
17
17
|
onClickButton
|
|
18
18
|
} = props
|
|
19
19
|
|
|
20
|
-
const theme = useTheme()
|
|
21
|
-
|
|
22
|
-
const errorImage = image || theme.images?.general?.notFound
|
|
23
20
|
|
|
24
21
|
return (
|
|
25
22
|
<>
|
|
@@ -30,12 +27,10 @@ export const NotFoundSource = (props) => {
|
|
|
30
27
|
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
31
28
|
<BeforeComponent key={i} {...props} />))}
|
|
32
29
|
<NotFound id='not-found-source'>
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)}
|
|
38
|
-
{content && conditioned && !errorImage && <h1>{content}</h1>}
|
|
30
|
+
<NotFoundImage>
|
|
31
|
+
<FdPageSearch />
|
|
32
|
+
</NotFoundImage>
|
|
33
|
+
{content && conditioned && <h1>{content}</h1>}
|
|
39
34
|
{content && !conditioned && <h1>{content}</h1>}
|
|
40
35
|
{!onClickButton && props.children && (
|
|
41
36
|
props.children
|