ordering-ui-external 1.5.5 → 1.6.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.cb87b9b647114f245c57.js → 0.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/{1.ordering-ui.cb87b9b647114f245c57.js → 1.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/{2.ordering-ui.cb87b9b647114f245c57.js → 2.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/{4.ordering-ui.cb87b9b647114f245c57.js → 4.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/{5.ordering-ui.cb87b9b647114f245c57.js → 5.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/{6.ordering-ui.cb87b9b647114f245c57.js → 6.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/7.ordering-ui.9399c2752e3ad5f2250b.js +2 -0
- package/_bundles/{7.ordering-ui.cb87b9b647114f245c57.js.LICENSE.txt → 7.ordering-ui.9399c2752e3ad5f2250b.js.LICENSE.txt} +18 -0
- package/_bundles/{8.ordering-ui.cb87b9b647114f245c57.js → 8.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/{9.ordering-ui.cb87b9b647114f245c57.js → 9.ordering-ui.9399c2752e3ad5f2250b.js} +1 -1
- package/_bundles/ordering-ui.9399c2752e3ad5f2250b.js +2 -0
- package/_bundles/{ordering-ui.cb87b9b647114f245c57.js.LICENSE.txt → ordering-ui.9399c2752e3ad5f2250b.js.LICENSE.txt} +0 -0
- package/_modules/components/BusinessTypeFilter/index.js +6 -3
- package/_modules/components/CancellationComponent/index.js +58 -0
- package/_modules/components/CancellationComponent/styles.js +43 -0
- package/_modules/components/Header/index.js +1 -1
- package/_modules/index.js +7 -0
- package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +1 -1
- package/_modules/themes/five/src/components/AddressForm/index.js +5 -5
- package/_modules/themes/five/src/components/AddressList/index.js +3 -1
- package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +4 -2
- package/_modules/themes/five/src/components/BusinessController/index.js +22 -13
- package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessReviews/index.js +4 -4
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +8 -5
- package/_modules/themes/five/src/components/CartPopover/styles.js +1 -1
- package/_modules/themes/five/src/components/Footer/index.js +7 -2
- package/_modules/themes/five/src/components/Header/index.js +6 -3
- package/_modules/themes/five/src/components/HomeHero/index.js +5 -3
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +15 -7
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +21 -18
- package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +2 -2
- package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderDetails/OrderActionsSection.js +38 -0
- package/_modules/themes/five/src/components/OrderDetails/OrderHeaderInfoSection.js +27 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +65 -61
- package/_modules/themes/five/src/components/OrderDetails/styles.js +7 -5
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +2 -2
- package/_modules/themes/five/src/components/OrdersOption/index.js +4 -2
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +5 -3
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +7 -0
- package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
- package/_modules/themes/five/src/components/SingleProductCard/index.js +4 -4
- package/_modules/themes/five/src/components/UserFormDetails/index.js +51 -26
- package/_modules/themes/five/src/components/UserFormDetails/styles.js +9 -3
- package/_modules/themes/five/src/components/UserVerification/index.js +7 -2
- package/index-template.js +9 -5
- package/package.json +2 -2
- package/src/components/BusinessTypeFilter/index.js +2 -2
- package/src/components/CancellationComponent/index.js +62 -0
- package/src/components/CancellationComponent/styles.js +162 -0
- package/src/components/Header/index.js +1 -1
- package/src/index.js +2 -0
- package/src/themes/callcenterOriginal/src/components/Header/styles.js +1 -0
- package/src/themes/five/src/components/AddressForm/index.js +2 -2
- package/src/themes/five/src/components/AddressList/index.js +2 -1
- package/src/themes/five/src/components/AddressList/styles.js +4 -1
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +3 -2
- package/src/themes/five/src/components/BusinessController/index.js +68 -44
- package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +6 -1
- package/src/themes/five/src/components/BusinessReviews/index.js +4 -4
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +16 -12
- package/src/themes/five/src/components/CartPopover/styles.js +1 -1
- package/src/themes/five/src/components/Footer/index.js +6 -3
- package/src/themes/five/src/components/Header/index.js +4 -3
- package/src/themes/five/src/components/HomeHero/index.js +4 -2
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +18 -6
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +3 -0
- package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +1 -1
- package/src/themes/five/src/components/MultiOrdersDetails/styles.js +5 -1
- package/src/themes/five/src/components/OrderDetails/OrderActionsSection.js +33 -0
- package/src/themes/five/src/components/OrderDetails/OrderHeaderInfoSection.js +20 -0
- package/src/themes/five/src/components/OrderDetails/index.js +85 -101
- package/src/themes/five/src/components/OrderDetails/styles.js +4 -1
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +4 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +2 -2
- package/src/themes/five/src/components/OrdersOption/index.js +3 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +4 -2
- package/src/themes/five/src/components/RenderProductsLayout/index.js +10 -1
- package/src/themes/five/src/components/SignUpApproval/index.js +6 -7
- package/src/themes/five/src/components/SingleProductCard/index.js +3 -3
- package/src/themes/five/src/components/UserFormDetails/index.js +59 -23
- package/src/themes/five/src/components/UserFormDetails/styles.js +26 -0
- package/src/themes/five/src/components/UserVerification/index.js +18 -11
- package/template/app.js +394 -370
- package/template/assets/images/home-hero-mobile.jpg +0 -0
- package/template/components/HelmetTags/index.js +4 -2
- package/template/components/SubdomainComponent/index.js +61 -0
- package/template/config.json +4 -1
- package/template/pages/Home/index.js +5 -3
- package/_bundles/7.ordering-ui.cb87b9b647114f245c57.js +0 -2
- package/_bundles/ordering-ui.cb87b9b647114f245c57.js +0 -2
|
@@ -33,7 +33,6 @@ import { Confirm } from '../Confirm'
|
|
|
33
33
|
import {
|
|
34
34
|
Container,
|
|
35
35
|
WrapperContainer,
|
|
36
|
-
HeaderInfo,
|
|
37
36
|
Content,
|
|
38
37
|
OrderBusiness,
|
|
39
38
|
BusinessWrapper,
|
|
@@ -52,7 +51,6 @@ import {
|
|
|
52
51
|
ShareOrder,
|
|
53
52
|
WrapperLeftContainer,
|
|
54
53
|
WrapperRightContainer,
|
|
55
|
-
MyOrderActions,
|
|
56
54
|
ReviewOrderLink,
|
|
57
55
|
SkeletonWrapper,
|
|
58
56
|
ReviewWrapper,
|
|
@@ -67,6 +65,7 @@ import {
|
|
|
67
65
|
LinkWrapper,
|
|
68
66
|
MapWrapper,
|
|
69
67
|
BusinessExternalWrapper,
|
|
68
|
+
DirectionButtonWrapper,
|
|
70
69
|
ProfessionalWrapper,
|
|
71
70
|
ProfessionalBlock
|
|
72
71
|
} from './styles'
|
|
@@ -76,6 +75,8 @@ import { TaxInformation } from '../TaxInformation'
|
|
|
76
75
|
import { getGoogleMapImage } from '../../../../../utils'
|
|
77
76
|
import { OrderHistory } from './OrderHistory'
|
|
78
77
|
import { ReviewProfessional } from '../ReviewProfessional'
|
|
78
|
+
import { OrderActionsSection } from './OrderActionsSection'
|
|
79
|
+
import { OrderHeaderInfoSection } from './OrderHeaderInfoSection'
|
|
79
80
|
|
|
80
81
|
const OrderDetailsUI = (props) => {
|
|
81
82
|
const {
|
|
@@ -142,6 +143,7 @@ const OrderDetailsUI = (props) => {
|
|
|
142
143
|
const showCustomerPhone = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.phone?.hidden
|
|
143
144
|
const showCustomerAddress = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.address?.hidden
|
|
144
145
|
const showCustomerEmail = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.email?.hidden
|
|
146
|
+
const showCustomerPhoto = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.photo?.hidden
|
|
145
147
|
|
|
146
148
|
const getOrderStatus = (s) => {
|
|
147
149
|
const status = parseInt(s)
|
|
@@ -177,6 +179,9 @@ const OrderDetailsUI = (props) => {
|
|
|
177
179
|
return objectStatus && objectStatus
|
|
178
180
|
}
|
|
179
181
|
|
|
182
|
+
const validTrackingStatus = [9, 19, 23]
|
|
183
|
+
const mapConfigs = { zoom: 15 }
|
|
184
|
+
|
|
180
185
|
const handleGoToPage = (data) => {
|
|
181
186
|
events.emit('go_to_page', data)
|
|
182
187
|
}
|
|
@@ -337,9 +342,19 @@ const OrderDetailsUI = (props) => {
|
|
|
337
342
|
setUnreadAlert
|
|
338
343
|
}
|
|
339
344
|
|
|
345
|
+
const driverLocationString = typeof order?.driver?.location?.location === 'string' && order?.driver?.location?.location?.split(',').map((l) => l.replace(/[^-.0-9]/g, ''))
|
|
346
|
+
const parsedLocations = locations.map(location => typeof location?.location === 'string' ? {
|
|
347
|
+
...location,
|
|
348
|
+
lat: parseFloat(location?.location?.split(',')[0].replace(/[^-.0-9]/g, '')),
|
|
349
|
+
lng: parseFloat(location?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
|
|
350
|
+
} : location)
|
|
351
|
+
|
|
340
352
|
useEffect(() => {
|
|
341
353
|
if (driverLocation) {
|
|
342
|
-
|
|
354
|
+
parsedLocations[0] = {
|
|
355
|
+
...locations[0],
|
|
356
|
+
...driverLocation
|
|
357
|
+
}
|
|
343
358
|
}
|
|
344
359
|
}, [driverLocation])
|
|
345
360
|
|
|
@@ -382,70 +397,6 @@ const OrderDetailsUI = (props) => {
|
|
|
382
397
|
businessLogoUrlValidation()
|
|
383
398
|
}, [order])
|
|
384
399
|
|
|
385
|
-
const OrderMapSection = (props) => {
|
|
386
|
-
const validStatuses = props.validStatuses ?? [9, 19, 23]
|
|
387
|
-
const location = props.location ?? order?.driver?.location
|
|
388
|
-
const mapConfigs = { zoom: 15 }
|
|
389
|
-
return (
|
|
390
|
-
showBusinessMap ? (
|
|
391
|
-
props.isMapImg ? (
|
|
392
|
-
<Map style={props.mapStyle}>
|
|
393
|
-
<img
|
|
394
|
-
src={getGoogleMapImage(location, googleMapsApiKey, mapConfigs)}
|
|
395
|
-
id='google-maps-image'
|
|
396
|
-
alt='google-maps-location'
|
|
397
|
-
width='100%'
|
|
398
|
-
height='100%'
|
|
399
|
-
loading='lazy'
|
|
400
|
-
/>
|
|
401
|
-
</Map>
|
|
402
|
-
) : (
|
|
403
|
-
location?.lat && location?.lng && validStatuses.includes(parseInt(order?.status)) ? (
|
|
404
|
-
<>
|
|
405
|
-
<Map style={props.mapStyle}>
|
|
406
|
-
<GoogleMapsMap
|
|
407
|
-
apiKey={configs?.google_maps_api_key?.value}
|
|
408
|
-
location={location}
|
|
409
|
-
locations={!props.location && locations}
|
|
410
|
-
mapControls={googleMapsControls}
|
|
411
|
-
/>
|
|
412
|
-
</Map>
|
|
413
|
-
</>
|
|
414
|
-
) : null
|
|
415
|
-
)
|
|
416
|
-
) : null
|
|
417
|
-
)
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
const OrderHeaderInfoSection = () => {
|
|
421
|
-
return (
|
|
422
|
-
<HeaderInfo>
|
|
423
|
-
<h1>{isService ? t('SERVICES', 'Services') : t('ORDER_MESSAGE_RECEIVED', theme?.defaultLanguages?.ORDER_MESSAGE_RECEIVED || 'Your order has been received')}</h1>
|
|
424
|
-
<p>{!isService && t('ORDER_MESSAGE_HEADER_TEXT', theme?.defaultLanguages?.ORDER_MESSAGE_HEADER_TEXT || 'Once business accepts your order, we will send you an email, thank you!')}</p>
|
|
425
|
-
</HeaderInfo>
|
|
426
|
-
)
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
const OrderActionsSection = () => {
|
|
430
|
-
return (
|
|
431
|
-
<>
|
|
432
|
-
{!userCustomerId && (
|
|
433
|
-
<MyOrderActions>
|
|
434
|
-
<Button
|
|
435
|
-
color='primary'
|
|
436
|
-
outline
|
|
437
|
-
onClick={() => handleGoToPage({ page: 'orders' })}
|
|
438
|
-
>
|
|
439
|
-
{isService
|
|
440
|
-
? t('YOUR_APPOINTMENTS', 'Your appointments')
|
|
441
|
-
: t('YOUR_ORDERS', theme?.defaultLanguages?.YOUR_ORDERS || 'Your Orders')}
|
|
442
|
-
</Button>
|
|
443
|
-
</MyOrderActions>
|
|
444
|
-
)}
|
|
445
|
-
</>
|
|
446
|
-
)
|
|
447
|
-
}
|
|
448
|
-
|
|
449
400
|
return (
|
|
450
401
|
<Container>
|
|
451
402
|
{!loading && order && Object.keys(order).length > 0 && !(openMessages.driver || openMessages.business) && (
|
|
@@ -484,33 +435,33 @@ const OrderDetailsUI = (props) => {
|
|
|
484
435
|
}
|
|
485
436
|
</p>
|
|
486
437
|
)}
|
|
487
|
-
{(
|
|
488
|
-
acceptedStatus.includes(parseInt(order?.status, 10)) ||
|
|
438
|
+
{(acceptedStatus.includes(parseInt(order?.status, 10)) ||
|
|
489
439
|
!isOriginalLayout
|
|
490
|
-
) &&
|
|
491
|
-
|
|
492
|
-
<
|
|
493
|
-
color='primary'
|
|
494
|
-
outline
|
|
495
|
-
onClick={() => handleStartNewOrder(order.id)}
|
|
496
|
-
disabled={reorderState?.loading}
|
|
497
|
-
>
|
|
498
|
-
{t('START_NEW_ORDER', 'Start new order')}
|
|
499
|
-
</Button>
|
|
500
|
-
{completedStatus.includes(parseInt(order?.status, 10)) && (
|
|
440
|
+
) &&
|
|
441
|
+
(
|
|
442
|
+
<ReOrder>
|
|
501
443
|
<Button
|
|
502
444
|
color='primary'
|
|
503
445
|
outline
|
|
504
|
-
onClick={() =>
|
|
446
|
+
onClick={() => handleStartNewOrder(order.id)}
|
|
505
447
|
disabled={reorderState?.loading}
|
|
506
448
|
>
|
|
507
|
-
{
|
|
508
|
-
? t('LOADING', 'Loading...')
|
|
509
|
-
: t('REORDER', 'Reorder')}
|
|
449
|
+
{t('START_NEW_ORDER', 'Start new order')}
|
|
510
450
|
</Button>
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
451
|
+
{completedStatus.includes(parseInt(order?.status, 10)) && (
|
|
452
|
+
<Button
|
|
453
|
+
color='primary'
|
|
454
|
+
outline
|
|
455
|
+
onClick={() => handleClickReorder(order)}
|
|
456
|
+
disabled={reorderState?.loading}
|
|
457
|
+
>
|
|
458
|
+
{reorderState?.loading
|
|
459
|
+
? t('LOADING', 'Loading...')
|
|
460
|
+
: t('REORDER', 'Reorder')}
|
|
461
|
+
</Button>
|
|
462
|
+
)}
|
|
463
|
+
</ReOrder>
|
|
464
|
+
)}
|
|
514
465
|
</TitleContainer>
|
|
515
466
|
{showDeliveryProgress && (
|
|
516
467
|
<>
|
|
@@ -570,6 +521,16 @@ const OrderDetailsUI = (props) => {
|
|
|
570
521
|
</p>
|
|
571
522
|
</PlaceSpotSection>
|
|
572
523
|
)}
|
|
524
|
+
{showOrderActions && (
|
|
525
|
+
<DirectionButtonWrapper>
|
|
526
|
+
<Button
|
|
527
|
+
color='primary'
|
|
528
|
+
onClick={() => window.open(`http://maps.google.com/?q=${order?.business?.address}`)}
|
|
529
|
+
>
|
|
530
|
+
{t('GET_DIRECTIONS', 'Get Directions')}
|
|
531
|
+
</Button>
|
|
532
|
+
</DirectionButtonWrapper>
|
|
533
|
+
)}
|
|
573
534
|
</BusinessInfo>
|
|
574
535
|
</BusinessWrapper>
|
|
575
536
|
|
|
@@ -599,7 +560,7 @@ const OrderDetailsUI = (props) => {
|
|
|
599
560
|
style={{ fontSize: 14 }}
|
|
600
561
|
color={order?.status === 20 ? 'secundary' : 'primary'}
|
|
601
562
|
onClick={() => handleChangeOrderStatus(20)}
|
|
602
|
-
disabled={order?.status === 20}
|
|
563
|
+
disabled={order?.status === 20 || order?.status === 21}
|
|
603
564
|
>
|
|
604
565
|
{getOrderStatus(20)?.value}
|
|
605
566
|
</Button>
|
|
@@ -618,20 +579,24 @@ const OrderDetailsUI = (props) => {
|
|
|
618
579
|
</BusinessWrapper>
|
|
619
580
|
)}
|
|
620
581
|
</BusinessExternalWrapper>
|
|
621
|
-
{googleMapsApiKey && (
|
|
582
|
+
{googleMapsApiKey && showBusinessMap && (
|
|
622
583
|
<MapWrapper>
|
|
623
|
-
<
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
584
|
+
<Map style={{ width: '100%' }}>
|
|
585
|
+
<img
|
|
586
|
+
src={getGoogleMapImage(order?.business?.location, googleMapsApiKey, mapConfigs)}
|
|
587
|
+
id='google-maps-image'
|
|
588
|
+
alt='google-maps-location'
|
|
589
|
+
width='100%'
|
|
590
|
+
height='100%'
|
|
591
|
+
loading='lazy'
|
|
592
|
+
/>
|
|
593
|
+
</Map>
|
|
629
594
|
</MapWrapper>
|
|
630
595
|
)}
|
|
631
596
|
</OrderBusiness>
|
|
632
597
|
<OrderCustomer>
|
|
633
598
|
<BusinessWrapper>
|
|
634
|
-
{order?.customer?.photo && (
|
|
599
|
+
{showCustomerPhoto && order?.customer?.photo && (
|
|
635
600
|
<img src={order?.customer?.photo} />
|
|
636
601
|
)}
|
|
637
602
|
<BusinessInfo>
|
|
@@ -683,9 +648,24 @@ const OrderDetailsUI = (props) => {
|
|
|
683
648
|
</div>
|
|
684
649
|
</WrapperDriver>
|
|
685
650
|
</OrderDriver>
|
|
686
|
-
{
|
|
687
|
-
|
|
688
|
-
|
|
651
|
+
{
|
|
652
|
+
order?.driver?.location &&
|
|
653
|
+
validTrackingStatus.includes(parseInt(order?.status)) &&
|
|
654
|
+
(
|
|
655
|
+
<Map style={{ width: '100%' }}>
|
|
656
|
+
<GoogleMapsMap
|
|
657
|
+
location={typeof order?.driver?.location?.location === 'string'
|
|
658
|
+
? {
|
|
659
|
+
lat: parseFloat(driverLocationString[0]),
|
|
660
|
+
lng: parseFloat(driverLocationString[1])
|
|
661
|
+
} : driverLocation ?? order?.driver?.location}
|
|
662
|
+
locations={parsedLocations}
|
|
663
|
+
mapControls={googleMapsControls}
|
|
664
|
+
apiKey={configs?.google_maps_api_key?.value}
|
|
665
|
+
/>
|
|
666
|
+
</Map>
|
|
667
|
+
)
|
|
668
|
+
}
|
|
689
669
|
</>
|
|
690
670
|
)}
|
|
691
671
|
{(order?.delivery_type === 1 || order?.comment) && (
|
|
@@ -700,8 +680,12 @@ const OrderDetailsUI = (props) => {
|
|
|
700
680
|
<WrapperRightContainer>
|
|
701
681
|
<OrderProducts>
|
|
702
682
|
<HeaderTitle>
|
|
703
|
-
<OrderHeaderInfoSection />
|
|
704
|
-
<OrderActionsSection
|
|
683
|
+
<OrderHeaderInfoSection isService={isService} />
|
|
684
|
+
<OrderActionsSection
|
|
685
|
+
userCustomerId={userCustomerId}
|
|
686
|
+
isService={isService}
|
|
687
|
+
handleGoToPage={handleGoToPage}
|
|
688
|
+
/>
|
|
705
689
|
</HeaderTitle>
|
|
706
690
|
{sortedProductList}
|
|
707
691
|
<OrderBillSection
|
|
@@ -737,6 +737,9 @@ export const BusinessExternalWrapper = styled.div`
|
|
|
737
737
|
width: 50%;
|
|
738
738
|
}
|
|
739
739
|
`
|
|
740
|
+
export const DirectionButtonWrapper = styled.div`
|
|
741
|
+
margin-top: 30px;
|
|
742
|
+
`
|
|
740
743
|
|
|
741
744
|
export const ProfessionalWrapper = styled.div`
|
|
742
745
|
display: flex;
|
|
@@ -786,4 +789,4 @@ export const ProfessionalWrapper = styled.div`
|
|
|
786
789
|
export const ProfessionalBlock = styled.div`
|
|
787
790
|
border-bottom: 1px solid ${props => props.theme.colors.disabled};
|
|
788
791
|
margin-bottom: 15px;
|
|
789
|
-
`
|
|
792
|
+
`
|
|
@@ -22,12 +22,14 @@ export const OrderTypeSelectorContentUI = (props) => {
|
|
|
22
22
|
|
|
23
23
|
const [, t] = useLanguage()
|
|
24
24
|
const [orderStatus] = useOrder()
|
|
25
|
-
|
|
25
|
+
const theme = useTheme()
|
|
26
26
|
const handleClickOrderType = (orderType) => {
|
|
27
27
|
onClose && onClose()
|
|
28
28
|
handleChangeOrderType && handleChangeOrderType(orderType)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
const orderTypeImage = (type) => theme?.header?.components?.order_types?.components?.[type]?.components?.image
|
|
32
|
+
|
|
31
33
|
return (
|
|
32
34
|
<div className='order-type' style={{ overflow: 'hidden' }}>
|
|
33
35
|
{props.beforeElements?.map((BeforeElement, i) => (
|
|
@@ -42,7 +44,7 @@ export const OrderTypeSelectorContentUI = (props) => {
|
|
|
42
44
|
orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value)) : orderTypes).map((item, i) => (
|
|
43
45
|
<OrderTypeListItemContainer
|
|
44
46
|
key={i}
|
|
45
|
-
bgimage={item?.image}
|
|
47
|
+
bgimage={orderTypeImage(item?.text?.replace(' ', '_')?.toLowerCase()) || item?.image}
|
|
46
48
|
onClick={() => handleClickOrderType(item.value)}
|
|
47
49
|
active={orderStatus?.options?.type === item?.value}
|
|
48
50
|
>
|
|
@@ -10,7 +10,7 @@ export const PreviousBusinessOrdered = (props) => {
|
|
|
10
10
|
isCustomLayout,
|
|
11
11
|
isCustomerMode,
|
|
12
12
|
onRedirectPage,
|
|
13
|
-
|
|
13
|
+
handleUpdateBusinesses,
|
|
14
14
|
businesses
|
|
15
15
|
} = props
|
|
16
16
|
|
|
@@ -45,7 +45,7 @@ export const PreviousBusinessOrdered = (props) => {
|
|
|
45
45
|
businessPickupTime={business?.pickup_time}
|
|
46
46
|
businessDistance={business?.distance}
|
|
47
47
|
firstCard={i === 0 && width > 681}
|
|
48
|
-
handleUpdateBusinessList={
|
|
48
|
+
handleUpdateBusinessList={handleUpdateBusinesses}
|
|
49
49
|
/>
|
|
50
50
|
))
|
|
51
51
|
}
|
|
@@ -66,7 +66,8 @@ const OrdersOptionUI = (props) => {
|
|
|
66
66
|
onBusinessClick,
|
|
67
67
|
professionals,
|
|
68
68
|
handleUpdateProfessionals,
|
|
69
|
-
businesses
|
|
69
|
+
businesses,
|
|
70
|
+
handleUpdateBusinesses
|
|
70
71
|
} = props
|
|
71
72
|
|
|
72
73
|
const [, t] = useLanguage()
|
|
@@ -228,6 +229,7 @@ const OrdersOptionUI = (props) => {
|
|
|
228
229
|
businesses={businesses}
|
|
229
230
|
onRedirectPage={onRedirectPage}
|
|
230
231
|
isLoadingOrders={loading}
|
|
232
|
+
handleUpdateBusinesses={handleUpdateBusinesses}
|
|
231
233
|
/>
|
|
232
234
|
)}
|
|
233
235
|
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
ScheduleInfoWrapper,
|
|
30
30
|
ScheduleInfo
|
|
31
31
|
} from './styles'
|
|
32
|
+
import { useTheme } from 'styled-components'
|
|
32
33
|
|
|
33
34
|
export const ProductItemAccordion = (props) => {
|
|
34
35
|
const {
|
|
@@ -44,6 +45,7 @@ export const ProductItemAccordion = (props) => {
|
|
|
44
45
|
isStore,
|
|
45
46
|
isConfirmationPage
|
|
46
47
|
} = props
|
|
48
|
+
const theme = useTheme()
|
|
47
49
|
const [, t] = useLanguage()
|
|
48
50
|
const [orderState] = useOrder()
|
|
49
51
|
const [{ parsePrice, parseDate }] = useUtils()
|
|
@@ -119,9 +121,9 @@ export const ProductItemAccordion = (props) => {
|
|
|
119
121
|
onClick={(e) => toggleAccordion(e)}
|
|
120
122
|
>
|
|
121
123
|
<ProductInfo className='info'>
|
|
122
|
-
{product?.images && showProductImage && (
|
|
124
|
+
{(product?.images || theme?.images?.dummies?.product) && showProductImage && (
|
|
123
125
|
<WrapperProductImage>
|
|
124
|
-
<ProductImage bgimage={product?.images} />
|
|
126
|
+
<ProductImage bgimage={product?.images || theme?.images?.dummies?.product} />
|
|
125
127
|
</WrapperProductImage>
|
|
126
128
|
)}
|
|
127
129
|
{product?.calendar_event ? (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useTheme } from 'styled-components'
|
|
3
3
|
import { useLanguage, useConfig, useUtils, useOrderingTheme } from 'ordering-components-external'
|
|
4
4
|
import CgSearch from '@meronex/icons/cg/CgSearch'
|
|
@@ -125,6 +125,15 @@ export const RenderProductsLayout = (props) => {
|
|
|
125
125
|
? ProductListLayoutGroceries
|
|
126
126
|
: BusinessProductsList
|
|
127
127
|
|
|
128
|
+
const handleSaveProduct = () => {
|
|
129
|
+
const productContainer = document.getElementsByClassName('bp-list')[0]
|
|
130
|
+
scrollTo(productContainer, 500, 1250)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
handleSaveProduct()
|
|
135
|
+
}, [categorySelected])
|
|
136
|
+
|
|
128
137
|
return (
|
|
129
138
|
<>
|
|
130
139
|
{!isLoading && business?.id && (
|
|
@@ -21,8 +21,7 @@ import {
|
|
|
21
21
|
export const SignUpApproval = (props) => {
|
|
22
22
|
const theme = useTheme()
|
|
23
23
|
const [, t] = useLanguage()
|
|
24
|
-
const { content: { project, dashboardUrl, dashboardLoginUrl, approvalType, businessType }, onAccept, onCancel } = props
|
|
25
|
-
const contactEmail = 'support@ordering.co'
|
|
24
|
+
const { content: { project, dashboardUrl, dashboardLoginUrl, approvalType, businessType, contactEmail }, onAccept, onCancel } = props
|
|
26
25
|
const showDomain = false
|
|
27
26
|
|
|
28
27
|
const logoImgUrl = businessType === 2
|
|
@@ -60,9 +59,9 @@ export const SignUpApproval = (props) => {
|
|
|
60
59
|
</tr>
|
|
61
60
|
<tr>
|
|
62
61
|
<td className='bigger td-text-right'>{t('DASHBOARD_WEBPAGE', 'Dashboard webpage')}: </td>
|
|
63
|
-
<td className='td-text-left'><a className='green-text' href={dashboardLoginUrl} target='_blank' rel='noopener noreferrer'>{dashboardUrl}</a></td>
|
|
62
|
+
<td className='td-text-left'><a className='green-text' href={t('SIGNUP_DASHBOARD_LOGIN_URL', dashboardLoginUrl)} target='_blank' rel='noopener noreferrer'>{t('SIGNUP_DASHBOARD_URL', dashboardUrl)}</a></td>
|
|
64
63
|
</tr>
|
|
65
|
-
</tbody>
|
|
64
|
+
</tbody>
|
|
66
65
|
</ProjectInfoContainer>
|
|
67
66
|
</BodySection>
|
|
68
67
|
) : (
|
|
@@ -71,13 +70,13 @@ export const SignUpApproval = (props) => {
|
|
|
71
70
|
<DescriptionContainer>
|
|
72
71
|
<Description><span className='bigger'>{t('YOUR_STORE_UNDER_APPROVAL', 'Your store is under approval')}</span></Description>
|
|
73
72
|
<Description>{t('BUSINESS_SIGNUP_MESSAGE', 'We will contact you as soon as possible')}</Description>
|
|
74
|
-
<Description>{t('FEEL_FREE_CONTACT_US', 'feel free to contact us at ')} <a className='green-text' href={`mailto:${t('SIGNUP_DRIVER_EMAIL', contactEmail)}`}>{contactEmail}</a></Description>
|
|
73
|
+
<Description>{t('FEEL_FREE_CONTACT_US', 'feel free to contact us at ')} <a className='green-text' href={`mailto:${t('SIGNUP_DRIVER_EMAIL', contactEmail)}`}>{t('SIGNUP_DRIVER_EMAIL', contactEmail)}</a></Description>
|
|
75
74
|
</DescriptionContainer>
|
|
76
75
|
) : (
|
|
77
76
|
<DescriptionContainer>
|
|
78
77
|
<Description><span className='bigger'>{t('REQUEST_TO_START_UNDER_APPROVAL', 'Your request to start as a driver is under approval.')}</span></Description>
|
|
79
78
|
<Description>{t('BUSINESS_SIGNUP_MESSAGE', 'We will contact you as soon as possible')}</Description>
|
|
80
|
-
<Description>{t('FEEL_FREE_CONTACT_US', 'feel free to contact us at ')} <a className='green-text' href={`mailto:${t('SIGNUP_DRIVER_EMAIL', contactEmail)}`}>{contactEmail}</a></Description>
|
|
79
|
+
<Description>{t('FEEL_FREE_CONTACT_US', 'feel free to contact us at ')} <a className='green-text' href={`mailto:${t('SIGNUP_DRIVER_EMAIL', contactEmail)}`}>{t('SIGNUP_DRIVER_EMAIL', contactEmail)}</a></Description>
|
|
81
80
|
</DescriptionContainer>
|
|
82
81
|
)}
|
|
83
82
|
</BodySection>
|
|
@@ -101,7 +100,7 @@ export const SignUpApproval = (props) => {
|
|
|
101
100
|
</Button>
|
|
102
101
|
</ActionGroup>
|
|
103
102
|
{(approvalType === 'automatic' && userType === 'business') && (
|
|
104
|
-
<ContactSection>{t('CONTACT_US_QUESTIONS', 'If you have some questions do no hestitate to contact us at ')} <a className='green-text' href={`mailto:${t('SIGNUP_DRIVER_EMAIL', contactEmail)}`}>{contactEmail}</a></ContactSection>
|
|
103
|
+
<ContactSection>{t('CONTACT_US_QUESTIONS', 'If you have some questions do no hestitate to contact us at ')} <a className='green-text' href={`mailto:${t('SIGNUP_DRIVER_EMAIL', contactEmail)}`}>{t('SIGNUP_DRIVER_EMAIL', contactEmail)}</a></ContactSection>
|
|
105
104
|
)}
|
|
106
105
|
</FooterSection>
|
|
107
106
|
</Container>
|
|
@@ -157,7 +157,7 @@ const SingleProductCardUI = (props) => {
|
|
|
157
157
|
<span>{productAddedToCartLength}</span>
|
|
158
158
|
</QuantityContainer>
|
|
159
159
|
)}
|
|
160
|
-
<CardInfo soldOut={isSoldOut || maxProductQuantity <= 0} isBgimage={optimizeImage(product?.images, 'h_86,c_limit')} oneLine={isPreviously}>
|
|
160
|
+
<CardInfo soldOut={isSoldOut || maxProductQuantity <= 0} isBgimage={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_86,c_limit')} oneLine={isPreviously}>
|
|
161
161
|
<TitleWrapper>
|
|
162
162
|
{!isSkeleton ? (<h1>{product?.name}</h1>) : (<Skeleton width={100} />)}
|
|
163
163
|
{!useKioskApp && !isPreviously && (
|
|
@@ -182,7 +182,7 @@ const SingleProductCardUI = (props) => {
|
|
|
182
182
|
{isPreviously && (!isSkeleton ? (<LastOrder>{t('LAST_ORDERED_ON', 'Last ordered on')} {parseDate(product?.last_ordered_date, { outputFormat: 'MMM DD, YYYY' })}</LastOrder>) : (<Skeleton width={80} />))}
|
|
183
183
|
</CardInfo>
|
|
184
184
|
{!isSkeleton ? (
|
|
185
|
-
<WrapLogo isBgimage={optimizeImage(product?.images, 'h_86,c_limit')}>
|
|
185
|
+
<WrapLogo isBgimage={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_86,c_limit')}>
|
|
186
186
|
{product?.ribbon?.enabled && (
|
|
187
187
|
<RibbonBox
|
|
188
188
|
bgColor={product?.ribbon?.color}
|
|
@@ -195,7 +195,7 @@ const SingleProductCardUI = (props) => {
|
|
|
195
195
|
<CardLogo
|
|
196
196
|
className='image'
|
|
197
197
|
soldOut={isSoldOut || maxProductQuantity <= 0}
|
|
198
|
-
bgimage={optimizeImage(product?.images, 'h_86,c_limit')}
|
|
198
|
+
bgimage={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_86,c_limit')}
|
|
199
199
|
/>
|
|
200
200
|
</WrapLogo>
|
|
201
201
|
) : (
|
|
@@ -13,9 +13,12 @@ import {
|
|
|
13
13
|
Divider,
|
|
14
14
|
InputPhoneNumberWrapper,
|
|
15
15
|
LanguageSelectorWrapper,
|
|
16
|
-
|
|
16
|
+
SwitchWrapper,
|
|
17
|
+
NotificationsGroupSwitchWrapper
|
|
17
18
|
} from './styles'
|
|
18
19
|
|
|
20
|
+
import { Switch } from '../../../../../styles/Switch'
|
|
21
|
+
|
|
19
22
|
import { Input } from '../../styles/Inputs'
|
|
20
23
|
import { Button } from '../../styles/Buttons'
|
|
21
24
|
import { InputPhoneNumber } from '../../../../../components/InputPhoneNumber'
|
|
@@ -42,7 +45,8 @@ export const UserFormDetailsUI = (props) => {
|
|
|
42
45
|
setWillVerifyOtpState,
|
|
43
46
|
handleChangePromotions,
|
|
44
47
|
isOldLayout,
|
|
45
|
-
requiredFields
|
|
48
|
+
requiredFields,
|
|
49
|
+
handleChangeNotifications
|
|
46
50
|
} = props
|
|
47
51
|
|
|
48
52
|
const formMethods = useForm()
|
|
@@ -57,13 +61,26 @@ export const UserFormDetailsUI = (props) => {
|
|
|
57
61
|
const [, { setUserCustomer }] = useCustomer()
|
|
58
62
|
const [isChanged, setIsChanged] = useState(false)
|
|
59
63
|
const emailInput = useRef(null)
|
|
60
|
-
|
|
64
|
+
|
|
61
65
|
const user = userData || userSession
|
|
62
|
-
|
|
66
|
+
|
|
67
|
+
const [notificationList, setNotificationList] = useState({
|
|
68
|
+
email: formState?.result?.result
|
|
69
|
+
? !!formState?.result?.result?.settings?.email?.newsletter
|
|
70
|
+
: !!(formState?.changes?.settings?.email?.newsletter ?? (user && user?.settings?.email?.newsletter)),
|
|
71
|
+
sms: formState?.result?.result
|
|
72
|
+
? !!formState?.result?.result?.settings?.sms?.newsletter
|
|
73
|
+
: !!(formState?.changes?.settings?.sms?.newsletter ?? (user && user?.settings?.sms?.newsletter)),
|
|
74
|
+
notification: formState?.result?.result
|
|
75
|
+
? !!formState?.result?.result?.settings?.notification?.newsletter
|
|
76
|
+
: !!(formState?.changes?.settings?.notification?.newsletter ?? (user && user?.settings?.notification?.newsletter))
|
|
77
|
+
})
|
|
78
|
+
|
|
63
79
|
const showCustomerCellphone = !orderingTheme?.theme?.profile?.components?.cellphone?.hidden
|
|
64
80
|
const showCustomerPassword = !orderingTheme?.theme?.profile?.components?.password?.hidden
|
|
65
81
|
const showCustomerPromotions = !orderingTheme?.theme?.profile?.components?.promotions?.hidden
|
|
66
82
|
const showLangauges = !orderingTheme?.theme?.profile?.components?.languages?.hidden
|
|
83
|
+
const showNotifications = !orderingTheme?.theme?.profile?.components?.notification_settings?.hidden
|
|
67
84
|
|
|
68
85
|
const closeAlert = () => {
|
|
69
86
|
setAlertState({
|
|
@@ -251,6 +268,17 @@ export const UserFormDetailsUI = (props) => {
|
|
|
251
268
|
if (requiredFields && !requiredFields.includes('cellphone')) setIsValidPhoneNumber(true)
|
|
252
269
|
}, [requiredFields])
|
|
253
270
|
|
|
271
|
+
const handleEditNotifications = (key, value) => {
|
|
272
|
+
setNotificationList({
|
|
273
|
+
...notificationList,
|
|
274
|
+
[key]: value
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
useEffect(()=> {
|
|
279
|
+
isEdit && handleChangeNotifications(notificationList)
|
|
280
|
+
},[notificationList])
|
|
281
|
+
|
|
254
282
|
return (
|
|
255
283
|
<>
|
|
256
284
|
{props.beforeElements?.map((BeforeElement, i) => (
|
|
@@ -359,28 +387,36 @@ export const UserFormDetailsUI = (props) => {
|
|
|
359
387
|
/>
|
|
360
388
|
</InputGroup>
|
|
361
389
|
)}
|
|
362
|
-
{
|
|
363
|
-
|
|
364
|
-
<
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
390
|
+
{showNotifications && showCustomerPromotions && !requiredFields && (
|
|
391
|
+
<>
|
|
392
|
+
<NotificationsGroupSwitchWrapper>
|
|
393
|
+
<p>{t('MARKETING_NOTIFICATIONS', 'Marketing Notifications')}</p>
|
|
394
|
+
<SwitchWrapper>
|
|
395
|
+
<p>{t('EMAILS', 'Emails')}</p>
|
|
396
|
+
<Switch
|
|
397
|
+
onChange={value => handleEditNotifications('email', value)}
|
|
398
|
+
defaultChecked={notificationList?.email}
|
|
399
|
+
/>
|
|
400
|
+
</SwitchWrapper>
|
|
401
|
+
<SwitchWrapper>
|
|
402
|
+
<p>{t('SMS', 'Sms')}</p>
|
|
403
|
+
<Switch
|
|
404
|
+
onChange={value => handleEditNotifications('sms', value)}
|
|
405
|
+
defaultChecked={notificationList?.sms}
|
|
406
|
+
/>
|
|
407
|
+
</SwitchWrapper>
|
|
408
|
+
<SwitchWrapper>
|
|
409
|
+
<p>{t('PUSH_NOTIFICATIONS', 'Push Notifications')}</p>
|
|
410
|
+
<Switch
|
|
411
|
+
onChange={value => handleEditNotifications('notification', value)}
|
|
412
|
+
defaultChecked={notificationList?.notification}
|
|
413
|
+
/>
|
|
414
|
+
</SwitchWrapper>
|
|
415
|
+
</NotificationsGroupSwitchWrapper>
|
|
416
|
+
</>
|
|
380
417
|
)}
|
|
381
418
|
{showLangauges && !requiredFields && (
|
|
382
419
|
<>
|
|
383
|
-
<Divider />
|
|
384
420
|
<LanguageSelectorWrapper>
|
|
385
421
|
<p>{t('LANGUAGE', 'Language')}</p>
|
|
386
422
|
<LanguageSelector />
|
|
@@ -182,3 +182,29 @@ export const PromotionsWrapper = styled.div`
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
`
|
|
185
|
+
|
|
186
|
+
export const NotificationsGroupSwitchWrapper = styled.div`
|
|
187
|
+
display: flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
width: 100%;
|
|
191
|
+
padding: 15px 0;
|
|
192
|
+
margin-bottom: 20px;
|
|
193
|
+
border-bottom: 1px solid #E9ECEF;
|
|
194
|
+
|
|
195
|
+
> p {
|
|
196
|
+
margin: 0;
|
|
197
|
+
font-weight: 500;
|
|
198
|
+
font-size: 20px;
|
|
199
|
+
color: ${props => props.theme.colors.darkTextColor};
|
|
200
|
+
width: 100%;
|
|
201
|
+
text-align: left;
|
|
202
|
+
}
|
|
203
|
+
`
|
|
204
|
+
|
|
205
|
+
export const SwitchWrapper = styled.div`
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
justify-content: space-between;
|
|
209
|
+
width: 100%;
|
|
210
|
+
`
|