ordering-ui-external 2.0.3 → 2.1.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.a228aa8797d9d0fc5a6c.js → 0.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{1.ordering-ui.a228aa8797d9d0fc5a6c.js → 1.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{2.ordering-ui.a228aa8797d9d0fc5a6c.js → 2.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{4.ordering-ui.a228aa8797d9d0fc5a6c.js → 4.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{5.ordering-ui.a228aa8797d9d0fc5a6c.js → 5.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{6.ordering-ui.a228aa8797d9d0fc5a6c.js → 6.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{7.ordering-ui.a228aa8797d9d0fc5a6c.js → 7.ordering-ui.3861d1cf52cf041c74c5.js} +1 -1
- package/_bundles/{7.ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt → 7.ordering-ui.3861d1cf52cf041c74c5.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.a228aa8797d9d0fc5a6c.js → 8.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{9.ordering-ui.a228aa8797d9d0fc5a6c.js → 9.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
- package/_bundles/{ordering-ui.a228aa8797d9d0fc5a6c.js → ordering-ui.3861d1cf52cf041c74c5.js} +2 -2
- package/_bundles/{ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt → ordering-ui.3861d1cf52cf041c74c5.js.LICENSE.txt} +0 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +36 -28
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +48 -34
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -1
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +9 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -1
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
- package/_modules/themes/five/src/components/Cart/index.js +73 -25
- package/_modules/themes/five/src/components/CartContent/index.js +3 -1
- package/_modules/themes/five/src/components/Checkout/index.js +25 -15
- package/_modules/themes/five/src/components/DriverTips/index.js +26 -15
- package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +63 -0
- package/_modules/themes/five/src/components/GiftCard/GiftCardUI/styles.js +27 -0
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +69 -0
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +29 -0
- package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +123 -0
- package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/styles.js +20 -0
- package/_modules/themes/five/src/components/GiftCard/SendGiftCard/index.js +114 -0
- package/_modules/themes/five/src/components/GiftCard/SendGiftCard/styles.js +14 -0
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/index.js +3 -1
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/LoginForm/index.js +6 -0
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +69 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +84 -76
- package/_modules/themes/five/src/components/OrderDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderItAgain/styles.js +3 -3
- package/_modules/themes/five/src/components/OrderProgress/index.js +5 -14
- package/_modules/themes/five/src/components/PaymentOptions/index.js +22 -8
- package/_modules/themes/five/src/components/PaymentOptions/styles.js +9 -7
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +20 -14
- package/_modules/themes/five/src/components/ProfessionalFilter/index.js +23 -25
- package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +6 -32
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +38 -22
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +3 -9
- package/_modules/themes/five/src/components/ServiceForm/index.js +10 -4
- package/_modules/themes/five/src/components/ServiceForm/styles.js +23 -25
- package/_modules/themes/five/src/components/SignUpForm/index.js +6 -0
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +22 -16
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -2
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +73 -51
- package/_modules/themes/five/src/components/SingleProfessionalCard/index.js +23 -7
- package/_modules/themes/five/src/components/SingleProfessionalCard/styles.js +29 -10
- package/_modules/themes/five/src/components/Wallets/index.js +2 -1
- package/package.json +2 -2
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +49 -35
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +26 -4
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -2
- package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +2 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
- package/src/themes/five/src/components/Cart/index.js +44 -14
- package/src/themes/five/src/components/CartContent/index.js +1 -0
- package/src/themes/five/src/components/Checkout/index.js +67 -51
- package/src/themes/five/src/components/DriverTips/index.js +52 -40
- package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +59 -0
- package/src/themes/five/src/components/GiftCard/GiftCardUI/styles.js +41 -0
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +70 -0
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +52 -0
- package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +122 -0
- package/src/themes/five/src/components/GiftCard/RedeemGiftCard/styles.js +41 -0
- package/src/themes/five/src/components/GiftCard/SendGiftCard/index.js +103 -0
- package/src/themes/five/src/components/GiftCard/SendGiftCard/styles.js +27 -0
- package/src/themes/five/src/components/HorizontalOrdersLayout/index.js +7 -4
- package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +0 -1
- package/src/themes/five/src/components/LoginForm/index.js +7 -0
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +59 -0
- package/src/themes/five/src/components/OrderDetails/index.js +141 -133
- package/src/themes/five/src/components/OrderDetails/styles.js +0 -1
- package/src/themes/five/src/components/OrderItAgain/styles.js +6 -6
- package/src/themes/five/src/components/OrderProgress/index.js +3 -12
- package/src/themes/five/src/components/PaymentOptions/index.js +26 -5
- package/src/themes/five/src/components/PaymentOptions/styles.js +4 -0
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +24 -4
- package/src/themes/five/src/components/ProfessionalFilter/index.js +18 -30
- package/src/themes/five/src/components/ProfessionalFilter/styles.js +1 -57
- package/src/themes/five/src/components/RenderProductsLayout/index.js +33 -17
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +0 -18
- package/src/themes/five/src/components/ServiceForm/index.js +11 -5
- package/src/themes/five/src/components/ServiceForm/styles.js +1 -9
- package/src/themes/five/src/components/SignUpForm/index.js +7 -0
- package/src/themes/five/src/components/SingleOrderCard/index.js +43 -26
- package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +12 -2
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +51 -4
- package/src/themes/five/src/components/SingleProfessionalCard/index.js +17 -6
- package/src/themes/five/src/components/SingleProfessionalCard/styles.js +33 -6
- package/src/themes/five/src/components/Wallets/index.js +2 -1
|
@@ -28,7 +28,9 @@ import { OrderBillSection } from './OrderBillSection'
|
|
|
28
28
|
import { ActionsSection } from './ActionsSection'
|
|
29
29
|
import { OrderPreferencesSection } from './OrderPreferencesSections'
|
|
30
30
|
import { PlaceSpot } from '../PlaceSpot'
|
|
31
|
+
import { SendGiftCard } from '../GiftCard/SendGiftCard'
|
|
31
32
|
import { Confirm } from '../Confirm'
|
|
33
|
+
import { OrderEta } from './OrderEta'
|
|
32
34
|
|
|
33
35
|
import {
|
|
34
36
|
Container,
|
|
@@ -111,6 +113,7 @@ const OrderDetailsUI = (props) => {
|
|
|
111
113
|
const [isProductReviewed, setIsProductReviewed] = useState(false)
|
|
112
114
|
const [isDriverReviewed, setIsDriverReviewed] = useState(false)
|
|
113
115
|
const [isProReviewed, setIsProReviewed] = useState(false)
|
|
116
|
+
const [isGiftCardSent, setIsGiftCardSent] = useState(false)
|
|
114
117
|
const [unreadAlert, setUnreadAlert] = useState({ business: false, driver: false })
|
|
115
118
|
const [isReviewOpen, setIsReviewOpen] = useState(false)
|
|
116
119
|
const [reviewStatus, setReviewStatus] = useState({ order: false, product: false, driver: false, professional: false })
|
|
@@ -124,29 +127,31 @@ const OrderDetailsUI = (props) => {
|
|
|
124
127
|
const acceptedStatus = [1, 2, 5, 6, 10, 11, 12]
|
|
125
128
|
const completedStatus = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
|
|
126
129
|
const placeSpotTypes = [3, 4, 5]
|
|
130
|
+
const activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23]
|
|
127
131
|
const googleMapsApiKey = configs?.google_maps_api_key?.value
|
|
128
132
|
const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
|
|
129
133
|
|
|
130
|
-
const
|
|
134
|
+
const hideOrderActions = order?.delivery_type === 1
|
|
135
|
+
const isGiftCardOrder = !order?.business_id
|
|
131
136
|
|
|
132
137
|
const isOriginalLayout = orderingTheme?.theme?.confirmation?.components?.layout?.type === 'original'
|
|
133
|
-
const
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
const
|
|
138
|
-
const
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
const
|
|
138
|
+
const hideDeliveryType = theme?.confirmation?.components?.order?.components?.delivery_type?.hidden
|
|
139
|
+
const hideDeliveryDate = theme?.confirmation?.components?.order?.components?.date?.hidden
|
|
140
|
+
const hideDeliveryProgress = theme?.confirmation?.components?.order?.components?.progress?.hidden
|
|
141
|
+
const hideBusinessPhone = theme?.confirmation?.components?.business?.components?.phone?.hidden
|
|
142
|
+
const hideBusinessMessages = theme?.confirmation?.components?.business?.components?.messages?.hidden
|
|
143
|
+
const hideBusinessEmail = theme?.confirmation?.components?.business?.components?.email?.hidden
|
|
144
|
+
const hideBusinessAddress = theme?.confirmation?.components?.business?.components?.address?.hidden
|
|
145
|
+
const hideBusinessMap = theme?.confirmation?.components?.business?.components?.map?.hidden
|
|
146
|
+
const hideDriverName = theme?.confirmation?.components?.driver?.components?.name?.hidden
|
|
147
|
+
const hideDriverPhone = theme?.confirmation?.components?.driver?.components?.phone?.hidden
|
|
148
|
+
const hideDriverMessages = theme?.confirmation?.components?.driver?.components?.messages?.hidden
|
|
149
|
+
const hideDriverEmail = theme?.confirmation?.components?.driver?.components?.email?.hidden
|
|
150
|
+
const hideDriverPhoto = theme?.confirmation?.components?.driver?.components?.photo?.hidden
|
|
151
|
+
const hideCustomerPhone = theme?.confirmation?.components?.customer?.components?.phone?.hidden
|
|
152
|
+
const hideCustomerAddress = theme?.confirmation?.components?.customer?.components?.address?.hidden
|
|
153
|
+
const hideCustomerEmail = theme?.confirmation?.components?.customer?.components?.email?.hidden
|
|
154
|
+
const hideCustomerPhoto = theme?.confirmation?.components?.customer?.components?.photo?.hidden
|
|
150
155
|
|
|
151
156
|
const validTrackingStatus = [9, 19, 23]
|
|
152
157
|
const mapConfigs = { zoom: 15 }
|
|
@@ -407,25 +412,25 @@ const OrderDetailsUI = (props) => {
|
|
|
407
412
|
{order?.status !== 0 && order?.integration_id && (
|
|
408
413
|
<h1>{t('TICKET', 'Ticket')}: {order?.integration_id}</h1>
|
|
409
414
|
)}
|
|
410
|
-
{
|
|
415
|
+
{!hideDeliveryType && (
|
|
411
416
|
<p className='types'>
|
|
412
417
|
{isService
|
|
413
418
|
? t('SERVICE_AT_HOME', 'Service at home')
|
|
414
419
|
: orderTypes?.find(type => order?.delivery_type === type?.value)?.text}
|
|
415
420
|
</p>
|
|
416
421
|
)}
|
|
417
|
-
{
|
|
422
|
+
{!hideDeliveryDate && (
|
|
418
423
|
<p className='date'>
|
|
419
|
-
{
|
|
420
|
-
order
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
+
{activeStatus.includes(order?.status) ? (
|
|
425
|
+
<OrderEta order={order} />
|
|
426
|
+
) : (
|
|
427
|
+
parseDate(order?.reporting_data?.at[`status:${order.status}`])
|
|
428
|
+
)}
|
|
424
429
|
</p>
|
|
425
430
|
)}
|
|
426
431
|
{(acceptedStatus.includes(parseInt(order?.status, 10)) ||
|
|
427
432
|
!isOriginalLayout
|
|
428
|
-
) &&
|
|
433
|
+
) && !isGiftCardOrder &&
|
|
429
434
|
(
|
|
430
435
|
<ReOrder>
|
|
431
436
|
<Button
|
|
@@ -451,7 +456,7 @@ const OrderDetailsUI = (props) => {
|
|
|
451
456
|
</ReOrder>
|
|
452
457
|
)}
|
|
453
458
|
</TitleContainer>
|
|
454
|
-
{
|
|
459
|
+
{!hideDeliveryProgress && !isGiftCardOrder && (
|
|
455
460
|
<>
|
|
456
461
|
<StatusBar percentage={getOrderStatus(order?.status)?.percentage} />
|
|
457
462
|
<OrderStatusAndLinkContainer>
|
|
@@ -478,120 +483,116 @@ const OrderDetailsUI = (props) => {
|
|
|
478
483
|
</>
|
|
479
484
|
)}
|
|
480
485
|
</OrderInfo>
|
|
481
|
-
|
|
482
|
-
<
|
|
483
|
-
<
|
|
484
|
-
w='calc(100% - 20px)'
|
|
485
|
-
// borderBottom={showOrderActions}
|
|
486
|
-
>
|
|
487
|
-
{isShowBusinessLogo && <img src={order?.business?.logo} />}
|
|
488
|
-
<BusinessInfo>
|
|
489
|
-
<h2>{order?.business?.name}</h2>
|
|
490
|
-
<ActionsSection
|
|
491
|
-
{...ActionsSectionProps}
|
|
492
|
-
actionType='business'
|
|
493
|
-
showPhone={showBusinessPhone}
|
|
494
|
-
showMessages={showBusinessMessages}
|
|
495
|
-
/>
|
|
496
|
-
{showBusinessEmail && (
|
|
497
|
-
<p>{order?.business?.email}</p>
|
|
498
|
-
)}
|
|
499
|
-
{showBusinessPhone && (
|
|
500
|
-
<p>{order?.business?.cellphone}</p>
|
|
501
|
-
)}
|
|
502
|
-
{showBusinessAddress && (
|
|
503
|
-
<p>{order?.business?.address}</p>
|
|
504
|
-
)}
|
|
505
|
-
{order?.place?.name && (
|
|
506
|
-
<PlaceSpotSection>
|
|
507
|
-
<p>
|
|
508
|
-
{yourSpotString}: {order?.place?.name}
|
|
509
|
-
</p>
|
|
510
|
-
</PlaceSpotSection>
|
|
511
|
-
)}
|
|
512
|
-
{showOrderActions && (
|
|
513
|
-
<DirectionButtonWrapper>
|
|
514
|
-
<Button
|
|
515
|
-
color='primary'
|
|
516
|
-
onClick={() => window.open(`http://maps.google.com/?q=${order?.business?.address}`)}
|
|
517
|
-
>
|
|
518
|
-
{t('GET_DIRECTIONS', 'Get Directions')}
|
|
519
|
-
</Button>
|
|
520
|
-
</DirectionButtonWrapper>
|
|
521
|
-
)}
|
|
522
|
-
</BusinessInfo>
|
|
523
|
-
</BusinessWrapper>
|
|
524
|
-
|
|
525
|
-
{showDeliveryType && placeSpotTypes.includes(order?.delivery_type) && (
|
|
526
|
-
<PlaceSpotWrapper>
|
|
527
|
-
<PlaceSpot
|
|
528
|
-
isInputMode
|
|
529
|
-
cart={order}
|
|
530
|
-
spotNumberDefault={order?.spot_number}
|
|
531
|
-
vehicleDefault={order?.vehicle}
|
|
532
|
-
/>
|
|
533
|
-
</PlaceSpotWrapper>
|
|
534
|
-
)}
|
|
535
|
-
|
|
536
|
-
{showOrderActions && (
|
|
486
|
+
{!isGiftCardOrder && (
|
|
487
|
+
<OrderBusiness>
|
|
488
|
+
<BusinessExternalWrapper>
|
|
537
489
|
<BusinessWrapper
|
|
538
490
|
w='calc(100% - 20px)'
|
|
539
|
-
borderTop
|
|
491
|
+
borderTop={!hideDeliveryType && placeSpotTypes.includes(order?.delivery_type)}
|
|
540
492
|
>
|
|
541
|
-
<
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
493
|
+
{isShowBusinessLogo && <img src={order?.business?.logo} />}
|
|
494
|
+
<BusinessInfo>
|
|
495
|
+
<h2>{order?.business?.name}</h2>
|
|
496
|
+
<ActionsSection
|
|
497
|
+
{...ActionsSectionProps}
|
|
498
|
+
actionType='business'
|
|
499
|
+
showPhone={!hideBusinessPhone}
|
|
500
|
+
showMessages={!hideBusinessMessages}
|
|
501
|
+
/>
|
|
502
|
+
{!hideBusinessEmail && (
|
|
503
|
+
<p>{order?.business?.email}</p>
|
|
504
|
+
)}
|
|
505
|
+
{!hideBusinessPhone && (
|
|
506
|
+
<p>{order?.business?.cellphone}</p>
|
|
507
|
+
)}
|
|
508
|
+
{!hideBusinessAddress && (
|
|
509
|
+
<p>{order?.business?.address}</p>
|
|
510
|
+
)}
|
|
511
|
+
{order?.place?.name && (
|
|
512
|
+
<PlaceSpotSection>
|
|
513
|
+
<p>
|
|
514
|
+
{yourSpotString}: {order?.place?.name}
|
|
515
|
+
</p>
|
|
516
|
+
</PlaceSpotSection>
|
|
517
|
+
)}
|
|
518
|
+
{hideOrderActions && (
|
|
519
|
+
<DirectionButtonWrapper>
|
|
520
|
+
<Button
|
|
521
|
+
color='primary'
|
|
522
|
+
onClick={() => window.open(`http://maps.google.com/?q=${order?.business?.address}`)}
|
|
523
|
+
>
|
|
524
|
+
{t('GET_DIRECTIONS', 'Get Directions')}
|
|
525
|
+
</Button>
|
|
526
|
+
</DirectionButtonWrapper>
|
|
527
|
+
)}
|
|
528
|
+
</BusinessInfo>
|
|
529
|
+
{!hideOrderActions && (
|
|
530
|
+
<BtsOrderStatus>
|
|
531
|
+
<div>
|
|
532
|
+
<Button
|
|
533
|
+
style={{ fontSize: 14 }}
|
|
534
|
+
color={order?.status === 20 ? 'secundary' : 'primary'}
|
|
535
|
+
onClick={() => handleChangeOrderStatus(20)}
|
|
536
|
+
disabled={disableLeftButton.includes(order?.status)}
|
|
537
|
+
>
|
|
538
|
+
{getOrderStatus(20)?.value}
|
|
539
|
+
</Button>
|
|
540
|
+
</div>
|
|
541
|
+
<div>
|
|
542
|
+
<Button
|
|
543
|
+
style={{ fontSize: 14 }}
|
|
544
|
+
color={order?.status === 20 ? 'primary' : 'secundary'}
|
|
545
|
+
disabled={disableRightButton.includes(order?.status)}
|
|
546
|
+
onClick={() => handleChangeOrderStatus(21)}
|
|
547
|
+
>
|
|
548
|
+
{getOrderStatus(21)?.value}
|
|
549
|
+
</Button>
|
|
550
|
+
</div>
|
|
551
|
+
</BtsOrderStatus>
|
|
552
|
+
)}
|
|
563
553
|
</BusinessWrapper>
|
|
554
|
+
|
|
555
|
+
{!hideDeliveryType && placeSpotTypes.includes(order?.delivery_type) && (
|
|
556
|
+
<PlaceSpotWrapper>
|
|
557
|
+
<PlaceSpot
|
|
558
|
+
isInputMode
|
|
559
|
+
cart={order}
|
|
560
|
+
spotNumberDefault={order?.spot_number}
|
|
561
|
+
vehicleDefault={order?.vehicle}
|
|
562
|
+
/>
|
|
563
|
+
</PlaceSpotWrapper>
|
|
564
|
+
)}
|
|
565
|
+
</BusinessExternalWrapper>
|
|
566
|
+
{googleMapsApiKey && !hideBusinessMap && (
|
|
567
|
+
<MapWrapper>
|
|
568
|
+
<Map style={{ width: '100%' }}>
|
|
569
|
+
<img
|
|
570
|
+
src={getGoogleMapImage(order?.business?.location, googleMapsApiKey, mapConfigs)}
|
|
571
|
+
id='google-maps-image'
|
|
572
|
+
alt='google-maps-location'
|
|
573
|
+
width='100%'
|
|
574
|
+
height='100%'
|
|
575
|
+
loading='lazy'
|
|
576
|
+
/>
|
|
577
|
+
</Map>
|
|
578
|
+
</MapWrapper>
|
|
564
579
|
)}
|
|
565
|
-
</
|
|
566
|
-
|
|
567
|
-
<MapWrapper>
|
|
568
|
-
<Map style={{ width: '100%' }}>
|
|
569
|
-
<img
|
|
570
|
-
src={getGoogleMapImage(order?.business?.location, googleMapsApiKey, mapConfigs)}
|
|
571
|
-
id='google-maps-image'
|
|
572
|
-
alt='google-maps-location'
|
|
573
|
-
width='100%'
|
|
574
|
-
height='100%'
|
|
575
|
-
loading='lazy'
|
|
576
|
-
/>
|
|
577
|
-
</Map>
|
|
578
|
-
</MapWrapper>
|
|
579
|
-
)}
|
|
580
|
-
</OrderBusiness>
|
|
580
|
+
</OrderBusiness>
|
|
581
|
+
)}
|
|
581
582
|
<OrderCustomer>
|
|
582
583
|
<BusinessWrapper>
|
|
583
|
-
{
|
|
584
|
+
{!hideCustomerPhoto && order?.customer?.photo && (
|
|
584
585
|
<img src={order?.customer?.photo} />
|
|
585
586
|
)}
|
|
586
587
|
<BusinessInfo>
|
|
587
588
|
<p>{order?.customer?.name} {order?.customer?.lastname}</p>
|
|
588
|
-
{
|
|
589
|
+
{!hideCustomerEmail && (
|
|
589
590
|
<p>{order?.customer?.email}</p>
|
|
590
591
|
)}
|
|
591
|
-
{
|
|
592
|
+
{!hideCustomerPhone && (
|
|
592
593
|
<p>{order?.customer?.cellphone || order?.customer?.phone}</p>
|
|
593
594
|
)}
|
|
594
|
-
{
|
|
595
|
+
{!hideCustomerAddress && (
|
|
595
596
|
<p>{order?.customer?.address}</p>
|
|
596
597
|
)}
|
|
597
598
|
</BusinessInfo>
|
|
@@ -605,12 +606,12 @@ const OrderDetailsUI = (props) => {
|
|
|
605
606
|
<ActionsSection
|
|
606
607
|
{...ActionsSectionProps}
|
|
607
608
|
actionType='driver'
|
|
608
|
-
showPhone={
|
|
609
|
-
showMessages={
|
|
609
|
+
showPhone={!hideDriverPhone}
|
|
610
|
+
showMessages={!hideDriverMessages}
|
|
610
611
|
/>
|
|
611
612
|
</SectionTitleContainer>
|
|
612
613
|
<WrapperDriver>
|
|
613
|
-
{
|
|
614
|
+
{!hideDriverPhoto && (
|
|
614
615
|
<div className='photo'>
|
|
615
616
|
{order?.driver?.photo ? (
|
|
616
617
|
<PhotoBlock src={order?.driver?.photo} />
|
|
@@ -620,13 +621,13 @@ const OrderDetailsUI = (props) => {
|
|
|
620
621
|
</div>
|
|
621
622
|
)}
|
|
622
623
|
<div>
|
|
623
|
-
{
|
|
624
|
+
{!hideDriverName && (
|
|
624
625
|
<h2>{order?.driver?.name} {order?.driver?.lastname}</h2>
|
|
625
626
|
)}
|
|
626
|
-
{
|
|
627
|
+
{!hideDriverEmail && (
|
|
627
628
|
<p>{order?.driver?.email}</p>
|
|
628
629
|
)}
|
|
629
|
-
{
|
|
630
|
+
{!hideDriverPhone && (
|
|
630
631
|
<p>{order?.driver?.cellphone || order?.driver?.phone}</p>
|
|
631
632
|
)}
|
|
632
633
|
</div>
|
|
@@ -652,7 +653,7 @@ const OrderDetailsUI = (props) => {
|
|
|
652
653
|
}
|
|
653
654
|
</>
|
|
654
655
|
)}
|
|
655
|
-
{(order?.delivery_type === 1 || order?.comment) && (
|
|
656
|
+
{(order?.delivery_type === 1 || order?.comment) && !isGiftCardOrder && (
|
|
656
657
|
<OrderPreferences>
|
|
657
658
|
<OrderPreferencesSection
|
|
658
659
|
order={order}
|
|
@@ -678,6 +679,13 @@ const OrderDetailsUI = (props) => {
|
|
|
678
679
|
/>
|
|
679
680
|
</OrderProducts>
|
|
680
681
|
</WrapperRightContainer>
|
|
682
|
+
|
|
683
|
+
{isGiftCardOrder && order?.products[0]?.gift_card?.status === 'pending' && !isGiftCardSent && (
|
|
684
|
+
<SendGiftCard
|
|
685
|
+
giftCardId={order?.products[0]?.gift_card?.id}
|
|
686
|
+
setIsGiftCardSent={setIsGiftCardSent}
|
|
687
|
+
/>
|
|
688
|
+
)}
|
|
681
689
|
</WrapperContainer>
|
|
682
690
|
)}
|
|
683
691
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components'
|
|
2
2
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
|
-
padding-top:
|
|
5
|
-
margin
|
|
4
|
+
padding-top: 5px;
|
|
5
|
+
margin: 0px;
|
|
6
6
|
${props => props.theme.rtl && css`
|
|
7
7
|
margin-left: 30px;
|
|
8
8
|
margin-right: 0px;
|
|
@@ -12,11 +12,13 @@ export const Container = styled.div`
|
|
|
12
12
|
margin-right: 0px;
|
|
13
13
|
margin-left: 0px;
|
|
14
14
|
`}
|
|
15
|
+
@media (min-width: 993px) {
|
|
16
|
+
margin-right: 30px;
|
|
17
|
+
}
|
|
15
18
|
`
|
|
16
19
|
|
|
17
20
|
export const ContentHeader = styled.div`
|
|
18
|
-
margin-bottom:
|
|
19
|
-
|
|
21
|
+
margin-bottom: 15px;
|
|
20
22
|
> h2 {
|
|
21
23
|
font-weight: 600;
|
|
22
24
|
font-size: 24px;
|
|
@@ -53,11 +55,9 @@ export const ProductList = styled.div`
|
|
|
53
55
|
flex-direction: row;
|
|
54
56
|
box-sizing: border-box;
|
|
55
57
|
align-items: center;
|
|
56
|
-
|
|
57
58
|
button {
|
|
58
59
|
padding: 0px;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
61
|
#orderItAgain > div {
|
|
62
62
|
width: 350px;
|
|
63
63
|
${({ theme }) => theme?.business_view?.components?.products?.components?.layout?.type === 'starbucks' && css`
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
OrderList as OrderListController
|
|
7
7
|
} from 'ordering-components-external'
|
|
8
8
|
import { Button } from '../../styles/Buttons'
|
|
9
|
-
import moment from 'moment'
|
|
10
9
|
import Skeleton from 'react-loading-skeleton'
|
|
11
10
|
import { useTheme } from 'styled-components'
|
|
12
11
|
import BsArrowRight from '@meronex/icons/bs/BsArrowRight'
|
|
12
|
+
import { OrderEta } from '../OrderDetails/OrderEta'
|
|
13
13
|
import {
|
|
14
14
|
OrderProgressContainer,
|
|
15
15
|
OrderInfoWrapper,
|
|
@@ -31,20 +31,11 @@ const OrderProgressUI = (props) => {
|
|
|
31
31
|
isCustomerMode
|
|
32
32
|
} = props
|
|
33
33
|
const [, t] = useLanguage()
|
|
34
|
-
const [{ optimizeImage,
|
|
34
|
+
const [{ optimizeImage, parseTime }] = useUtils()
|
|
35
35
|
const theme = useTheme()
|
|
36
36
|
const [events] = useEvent()
|
|
37
37
|
const [lastOrder, setLastOrder] = useState(null)
|
|
38
38
|
|
|
39
|
-
const convertDiffToHours = (time) => {
|
|
40
|
-
if (!time) return
|
|
41
|
-
const deliveryTime = lastOrder?.delivery_datetime_utc
|
|
42
|
-
? parseDate(lastOrder?.delivery_datetime_utc, { outputFormat: 'YYYY-MM-DD hh:mm A' })
|
|
43
|
-
: parseDate(lastOrder?.delivery_datetime, { utc: false, outputFormat: 'YYYY-MM-DD hh:mm A' })
|
|
44
|
-
const returnedDate = moment(new Date(deliveryTime.replace(/-/g, '/'))).add(time, 'minutes').format('hh:mm A')
|
|
45
|
-
return returnedDate
|
|
46
|
-
}
|
|
47
|
-
|
|
48
39
|
const handleGoToPage = (index) => {
|
|
49
40
|
events.emit('go_to_page', { page: index, params: { orderId: lastOrder?.uuid } })
|
|
50
41
|
}
|
|
@@ -102,7 +93,7 @@ const OrderProgressUI = (props) => {
|
|
|
102
93
|
? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
|
|
103
94
|
: parseTime(lastOrder?.delivery_datetime, { utc: false })}
|
|
104
95
|
-
|
|
105
|
-
{
|
|
96
|
+
<OrderEta order={lastOrder} outputFormat='hh:mm A' />
|
|
106
97
|
</span>
|
|
107
98
|
</TimeWrapper>
|
|
108
99
|
</ProgressTextWrapper>
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
PaymentOptions as PaymentOptionsController,
|
|
12
12
|
useLanguage,
|
|
13
13
|
useOrder,
|
|
14
|
-
useSession
|
|
14
|
+
useSession,
|
|
15
|
+
useValidationFields
|
|
15
16
|
} from 'ordering-components-external'
|
|
16
17
|
|
|
17
18
|
import { Modal } from '../Modal'
|
|
@@ -30,7 +31,8 @@ import {
|
|
|
30
31
|
PaymentMethodsList,
|
|
31
32
|
PayCard,
|
|
32
33
|
PayCardSelected,
|
|
33
|
-
CardItemContent
|
|
34
|
+
CardItemContent,
|
|
35
|
+
Container
|
|
34
36
|
} from './styles'
|
|
35
37
|
|
|
36
38
|
const stripeOptions = ['stripe_direct', 'stripe', 'stripe_connect']
|
|
@@ -100,8 +102,9 @@ const PaymentOptionsUI = (props) => {
|
|
|
100
102
|
} = props
|
|
101
103
|
const [, t] = useLanguage()
|
|
102
104
|
const [{ token }] = useSession()
|
|
105
|
+
const [{ options }] = useOrder()
|
|
103
106
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
104
|
-
|
|
107
|
+
const [validationFields] = useValidationFields()
|
|
105
108
|
const paymethodSelected = props.paySelected || props.paymethodSelected
|
|
106
109
|
|
|
107
110
|
const methodsPay = ['google_pay', 'apple_pay']
|
|
@@ -116,11 +119,25 @@ const PaymentOptionsUI = (props) => {
|
|
|
116
119
|
const supportedMethods = list?.filter(p => useKioskApp ? includeKioskPaymethods.includes(p.gateway) : p)
|
|
117
120
|
|
|
118
121
|
const handlePaymentMethodClick = (paymethod) => {
|
|
122
|
+
if (paymethod?.gateway === 'paypal' &&
|
|
123
|
+
options.type === 1 &&
|
|
124
|
+
validationFields?.fields?.checkout?.driver_tip?.enabled &&
|
|
125
|
+
validationFields?.fields?.checkout?.driver_tip?.required &&
|
|
126
|
+
(Number(cart?.driver_tip) <= 0)
|
|
127
|
+
) {
|
|
128
|
+
setAlertState({
|
|
129
|
+
open: true,
|
|
130
|
+
content: [t('DRIVER_TIPS_REQUIRED', 'Driver tips is required, please select a driver tip before select this paymethod')]
|
|
131
|
+
})
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
|
|
119
135
|
if (cart?.balance > 0) {
|
|
120
136
|
const isPopupMethod = popupMethods.includes(paymethod?.gateway)
|
|
121
137
|
handlePaymethodClick(paymethod, isPopupMethod)
|
|
122
138
|
return
|
|
123
139
|
}
|
|
140
|
+
|
|
124
141
|
setAlertState({
|
|
125
142
|
open: true,
|
|
126
143
|
content: [t('CART_BALANCE_ZERO', 'Sorry, the amount to pay is equal to zero and it is not necessary to select a payment method')]
|
|
@@ -227,7 +244,6 @@ const PaymentOptionsUI = (props) => {
|
|
|
227
244
|
setErrorCash={props.setErrorCash}
|
|
228
245
|
/>
|
|
229
246
|
)}
|
|
230
|
-
|
|
231
247
|
{isOpenMethod?.paymethod?.gateway === 'stripe' && isOpenMethod.paymethod?.gateway === 'stripe' && (
|
|
232
248
|
<PaymentOptionStripe
|
|
233
249
|
paymethod={isOpenMethod?.paymethod}
|
|
@@ -310,7 +326,12 @@ const PaymentOptionsUI = (props) => {
|
|
|
310
326
|
className='modal-info'
|
|
311
327
|
onClose={() => handlePaymethodClick(null)}
|
|
312
328
|
>
|
|
313
|
-
{
|
|
329
|
+
{!isOpenMethod?.paymethod?.credentials?.publishable &&
|
|
330
|
+
<Container>
|
|
331
|
+
<p>{t('ADD_PUBLISHABLE_KEY', 'Please add a stripe key')}</p>
|
|
332
|
+
</Container>
|
|
333
|
+
}
|
|
334
|
+
{isOpenMethod?.paymethod?.credentials?.publishable && stripeDirectMethods?.includes(isOpenMethod?.paymethod?.gateway) && (
|
|
314
335
|
<StripeElementsForm
|
|
315
336
|
methodsPay={methodsPay}
|
|
316
337
|
paymethod={isOpenMethod?.paymethod?.gateway}
|
|
@@ -92,11 +92,18 @@ export const QuantityControl = styled.div`
|
|
|
92
92
|
svg {
|
|
93
93
|
color: ${props => props.theme.colors.primary};
|
|
94
94
|
font-size: 20px;
|
|
95
|
-
margin-right:
|
|
95
|
+
margin-right: 6px;
|
|
96
96
|
${props => props.theme?.rtl && css`
|
|
97
|
-
margin-left:
|
|
97
|
+
margin-left: 6px;
|
|
98
98
|
margin-right: 0px;
|
|
99
99
|
`}
|
|
100
|
+
@media (min-width: 425px) {
|
|
101
|
+
margin-right: 3px
|
|
102
|
+
${props => props.theme?.rtl && css`
|
|
103
|
+
margin-right: 3px;
|
|
104
|
+
margin-left: 0px;
|
|
105
|
+
`}
|
|
106
|
+
}
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
svg[disabled] {
|
|
@@ -104,12 +111,20 @@ export const QuantityControl = styled.div`
|
|
|
104
111
|
}
|
|
105
112
|
|
|
106
113
|
svg:last-child {
|
|
107
|
-
margin-left:
|
|
114
|
+
margin-left: 6px;
|
|
108
115
|
margin-right: 0;
|
|
109
116
|
${props => props.theme?.rtl && css`
|
|
110
|
-
margin-right:
|
|
117
|
+
margin-right: 6px;
|
|
111
118
|
margin-left: 0px;
|
|
112
119
|
`}
|
|
120
|
+
@media (min-width: 425px) {
|
|
121
|
+
margin-left: 3px;
|
|
122
|
+
margin-right: 0;
|
|
123
|
+
${props => props.theme?.rtl && css`
|
|
124
|
+
margin-right: 3px;
|
|
125
|
+
margin-left: 0px;
|
|
126
|
+
`}
|
|
127
|
+
}
|
|
113
128
|
}
|
|
114
129
|
`
|
|
115
130
|
|
|
@@ -167,7 +182,12 @@ export const LeftOptionContainer = styled.div`
|
|
|
167
182
|
|
|
168
183
|
export const RightOptionContainer = styled.div`
|
|
169
184
|
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
170
186
|
width: 25%;
|
|
171
187
|
align-items: center;
|
|
172
188
|
justify-content: space-between;
|
|
189
|
+
|
|
190
|
+
@media (min-width: 425px) {
|
|
191
|
+
flex-direction: row;
|
|
192
|
+
}
|
|
173
193
|
`
|