ordering-ui-external 2.1.4 → 2.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.95882a524750766186cd.js +1 -0
- package/_bundles/{1.ordering-ui.28ae84b35994ed466773.js → 1.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{2.ordering-ui.28ae84b35994ed466773.js → 2.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/4.ordering-ui.95882a524750766186cd.js +1 -0
- package/_bundles/{5.ordering-ui.28ae84b35994ed466773.js → 5.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{6.ordering-ui.28ae84b35994ed466773.js → 6.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{7.ordering-ui.28ae84b35994ed466773.js → 7.ordering-ui.95882a524750766186cd.js} +2 -2
- package/_bundles/{7.ordering-ui.28ae84b35994ed466773.js.LICENSE.txt → 7.ordering-ui.95882a524750766186cd.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.28ae84b35994ed466773.js → 8.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{9.ordering-ui.28ae84b35994ed466773.js → 9.ordering-ui.95882a524750766186cd.js} +1 -1
- package/_bundles/{ordering-ui.28ae84b35994ed466773.js → ordering-ui.95882a524750766186cd.js} +2 -2
- package/_bundles/{ordering-ui.28ae84b35994ed466773.js.LICENSE.txt → ordering-ui.95882a524750766186cd.js.LICENSE.txt} +0 -0
- package/_modules/hooks/useIntersectionObserver.js +6 -5
- package/_modules/styles/Toast/index.js +4 -3
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +1 -1
- 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/index.js +2 -1
- package/_modules/themes/five/src/components/Cart/styles.js +1 -1
- package/_modules/themes/five/src/components/Checkout/index.js +23 -18
- 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 +20 -8
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +15 -13
- 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/OrderProgress/index.js +4 -3
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/PaymentOptions/index.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/callcenterOriginal/src/components/Header/index.js +1 -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/index.js +5 -1
- package/src/themes/five/src/components/Cart/styles.js +3 -1
- package/src/themes/five/src/components/Checkout/index.js +48 -61
- 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 +34 -14
- package/src/themes/five/src/components/MultiCheckout/styles.js +9 -0
- 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/OrderProgress/index.js +8 -2
- package/src/themes/five/src/components/PageBanner/styles.js +1 -0
- package/src/themes/five/src/components/PaymentOptions/index.js +1 -1
- 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
- package/_bundles/0.ordering-ui.28ae84b35994ed466773.js +0 -1
- package/_bundles/4.ordering-ui.28ae84b35994ed466773.js +0 -1
|
@@ -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 = {}
|
|
@@ -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 {
|
|
@@ -20,6 +20,7 @@ import { Alert } from '../Confirm'
|
|
|
20
20
|
import { UserDetails } from '../UserDetails'
|
|
21
21
|
import { AddressDetails } from '../AddressDetails'
|
|
22
22
|
import { MultiCartsPaymethodsAndWallets } from '../MultiCartsPaymethodsAndWallets'
|
|
23
|
+
import { CouponControl } from '../../../../../components/CouponControl'
|
|
23
24
|
|
|
24
25
|
import {
|
|
25
26
|
Container,
|
|
@@ -35,7 +36,8 @@ import {
|
|
|
35
36
|
PaymentMethodContainer,
|
|
36
37
|
WrapperPlaceOrderButton,
|
|
37
38
|
WarningText,
|
|
38
|
-
DriverTipContainer
|
|
39
|
+
DriverTipContainer,
|
|
40
|
+
CouponContainer
|
|
39
41
|
} from './styles'
|
|
40
42
|
import { DriverTips } from '../DriverTips'
|
|
41
43
|
|
|
@@ -209,6 +211,23 @@ const MultiCheckoutUI = (props) => {
|
|
|
209
211
|
/>
|
|
210
212
|
</PaymentMethodContainer>
|
|
211
213
|
|
|
214
|
+
{
|
|
215
|
+
validationFields?.fields?.checkout?.coupon?.enabled &&
|
|
216
|
+
openCarts.every(cart => cart.business_id && cart.status !== 2) &&
|
|
217
|
+
configs?.multi_business_checkout_coupon_input_style?.value === 'group' && (
|
|
218
|
+
<DriverTipContainer>
|
|
219
|
+
<h1>{t('DISCOUNT_COUPON', 'Discount coupon')}</h1>
|
|
220
|
+
<CouponContainer>
|
|
221
|
+
<CouponControl
|
|
222
|
+
carts={openCarts}
|
|
223
|
+
businessIds={openCarts.map(cart => cart.business_id)}
|
|
224
|
+
price={openCarts.reduce((total, cart) => total + cart.total, 0)}
|
|
225
|
+
/>
|
|
226
|
+
</CouponContainer>
|
|
227
|
+
</DriverTipContainer>
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
|
|
212
231
|
{
|
|
213
232
|
isMultiDriverTips &&
|
|
214
233
|
orderState?.options.type === 1 &&
|
|
@@ -244,9 +263,10 @@ const MultiCheckoutUI = (props) => {
|
|
|
244
263
|
{openCarts.map(cart => (
|
|
245
264
|
<React.Fragment key={cart.uuid}>
|
|
246
265
|
<Cart
|
|
247
|
-
isCartPending={cart?.status === 2}
|
|
248
266
|
cart={cart}
|
|
249
267
|
isMultiCheckout
|
|
268
|
+
isCartPending={cart?.status === 2}
|
|
269
|
+
hideCouponInput={configs?.multi_business_checkout_coupon_input_style?.value === 'group'}
|
|
250
270
|
isProducts={cart?.products?.length || 0}
|
|
251
271
|
hideDeliveryFee={configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1'}
|
|
252
272
|
hideDriverTip={configs?.multi_business_checkout_show_combined_driver_tip?.value === '1'}
|
|
@@ -263,20 +283,20 @@ const MultiCheckoutUI = (props) => {
|
|
|
263
283
|
<MultiCartPriceContainer totalFeeEnabled={totalFeeEnabled}>
|
|
264
284
|
{!!totalCartsFee &&
|
|
265
285
|
configs?.multi_business_checkout_show_combined_delivery_fee?.value === '1' &&
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
286
|
+
(
|
|
287
|
+
<span>
|
|
288
|
+
<p>{t('TOTAL_DELIVERY_FEE', 'Total delivery fee')}</p>
|
|
289
|
+
<p>{parsePrice(totalCartsFee)}</p>
|
|
290
|
+
</span>
|
|
291
|
+
)}
|
|
272
292
|
{openCarts.reduce((sum, cart) => sum + cart?.driver_tip, 0) > 0 &&
|
|
273
293
|
configs?.multi_business_checkout_show_combined_driver_tip?.value === '1' &&
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
294
|
+
(
|
|
295
|
+
<span>
|
|
296
|
+
<p>{t('DRIVER_TIP', 'Driver tip')}</p>
|
|
297
|
+
<p>{parsePrice(openCarts.reduce((sum, cart) => sum + cart?.driver_tip, 0))}</p>
|
|
298
|
+
</span>
|
|
299
|
+
)}
|
|
280
300
|
<div>
|
|
281
301
|
<h4>{t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}</h4>
|
|
282
302
|
<h4>{parsePrice(totalCartsPrice)}</h4>
|
|
@@ -36,6 +36,15 @@ export const WrapperLeftContent = styled.div`
|
|
|
36
36
|
margin-bottom: 5px;
|
|
37
37
|
}
|
|
38
38
|
`
|
|
39
|
+
|
|
40
|
+
export const CouponContainer = styled.div`
|
|
41
|
+
width: 100%;
|
|
42
|
+
|
|
43
|
+
input, button {
|
|
44
|
+
border-radius: 7.6px;
|
|
45
|
+
}
|
|
46
|
+
`
|
|
47
|
+
|
|
39
48
|
export const WrapperRightContainer = styled.div`
|
|
40
49
|
width: 100%;
|
|
41
50
|
background: #F8F9FA;
|
|
@@ -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
|
|
@@ -10,7 +10,8 @@ export const NotFound = styled.div`
|
|
|
10
10
|
margin: 20px auto;
|
|
11
11
|
|
|
12
12
|
h1 {
|
|
13
|
-
font-size:
|
|
13
|
+
font-size: 20px;
|
|
14
|
+
opacity: 0.5;
|
|
14
15
|
line-height: 24px;
|
|
15
16
|
text-align: center;
|
|
16
17
|
color: ${props => props.theme.colors?.headingColor};
|
|
@@ -24,7 +25,11 @@ export const NotFound = styled.div`
|
|
|
24
25
|
`
|
|
25
26
|
|
|
26
27
|
export const NotFoundImage = styled.div`
|
|
27
|
-
|
|
28
|
+
svg {
|
|
29
|
+
width: 150px;
|
|
30
|
+
height: 120px;
|
|
31
|
+
opacity: 0.5;
|
|
32
|
+
}
|
|
28
33
|
`
|
|
29
34
|
|
|
30
35
|
export const ButtonWrapper = styled.div`
|
|
@@ -67,7 +67,7 @@ export const OrderContextUI = (props) => {
|
|
|
67
67
|
|
|
68
68
|
return (
|
|
69
69
|
<>
|
|
70
|
-
<Container isBusinessList={isBusinessList}>
|
|
70
|
+
<Container isBusinessList={isBusinessList} hero={props.hideHero} >
|
|
71
71
|
<AddressMenu
|
|
72
72
|
onClick={() => handleClickAddress()}
|
|
73
73
|
isCheckOut={isCheckOut}
|
|
@@ -2,12 +2,14 @@ import styled, { css } from 'styled-components'
|
|
|
2
2
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
4
|
${({ isBusinessList }) => isBusinessList && css`
|
|
5
|
-
position: absolute;
|
|
6
|
-
top: 10%;
|
|
7
5
|
width: 100%;
|
|
8
6
|
padding: 0 15px;
|
|
9
7
|
box-sizing: border-box;
|
|
10
8
|
`}
|
|
9
|
+
${({ hero }) => hero && css`
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 10%;
|
|
12
|
+
`}
|
|
11
13
|
margin-top: 10px;
|
|
12
14
|
`
|
|
13
15
|
|
|
@@ -36,6 +36,8 @@ const OrderProgressUI = (props) => {
|
|
|
36
36
|
const [events] = useEvent()
|
|
37
37
|
const [lastOrder, setLastOrder] = useState(null)
|
|
38
38
|
|
|
39
|
+
const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
40
|
+
|
|
39
41
|
const handleGoToPage = (index) => {
|
|
40
42
|
events.emit('go_to_page', { page: index, params: { orderId: lastOrder?.uuid } })
|
|
41
43
|
}
|
|
@@ -58,7 +60,11 @@ const OrderProgressUI = (props) => {
|
|
|
58
60
|
<OrderProgressWrapper isChew={props.isChew}>
|
|
59
61
|
<OrderProgressContainer>
|
|
60
62
|
<OrderInfoWrapper>
|
|
61
|
-
<ProgressLogo
|
|
63
|
+
<ProgressLogo
|
|
64
|
+
bgimage={orderList?.orders.length === 1
|
|
65
|
+
? optimizeImage(lastOrder?.business?.logo || theme.images?.dummies?.businessLogo, 'h_91,c_limit')
|
|
66
|
+
: isChew ? theme.images.logos.chewLogoReverse : theme.images.logos.logotype}
|
|
67
|
+
/>
|
|
62
68
|
<ProgressDescriptionWrapper>
|
|
63
69
|
<h2>{t('ORDER_IN_PROGRESS', 'Order in progress')}</h2>
|
|
64
70
|
<p>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</p>
|
|
@@ -114,7 +120,7 @@ export const OrderProgress = (props) => {
|
|
|
114
120
|
useDefualtSessionManager: true,
|
|
115
121
|
paginationSettings: {
|
|
116
122
|
initialPage: 1,
|
|
117
|
-
pageSize:
|
|
123
|
+
pageSize: 10,
|
|
118
124
|
controlType: 'infinity'
|
|
119
125
|
}
|
|
120
126
|
}
|
|
@@ -94,10 +94,10 @@ export const AddCommentHideShow = styled.p`
|
|
|
94
94
|
transition: all 0.3s linear;
|
|
95
95
|
color: #909BA9;
|
|
96
96
|
font-size: 13px;
|
|
97
|
-
|
|
98
97
|
&:hover {
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
text-decoration: underline;
|
|
99
|
+
color: ${props => props.theme?.colors.primary};
|
|
100
|
+
}
|
|
101
101
|
|
|
102
102
|
${({ active }) => active && css`
|
|
103
103
|
color: ${props => props.theme?.colors.primary};
|