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.
Files changed (99) hide show
  1. package/_bundles/{0.ordering-ui.a228aa8797d9d0fc5a6c.js → 0.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  2. package/_bundles/{1.ordering-ui.a228aa8797d9d0fc5a6c.js → 1.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  3. package/_bundles/{2.ordering-ui.a228aa8797d9d0fc5a6c.js → 2.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  4. package/_bundles/{4.ordering-ui.a228aa8797d9d0fc5a6c.js → 4.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  5. package/_bundles/{5.ordering-ui.a228aa8797d9d0fc5a6c.js → 5.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  6. package/_bundles/{6.ordering-ui.a228aa8797d9d0fc5a6c.js → 6.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  7. package/_bundles/{7.ordering-ui.a228aa8797d9d0fc5a6c.js → 7.ordering-ui.3861d1cf52cf041c74c5.js} +1 -1
  8. package/_bundles/{7.ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt → 7.ordering-ui.3861d1cf52cf041c74c5.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.a228aa8797d9d0fc5a6c.js → 8.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  10. package/_bundles/{9.ordering-ui.a228aa8797d9d0fc5a6c.js → 9.ordering-ui.3861d1cf52cf041c74c5.js} +0 -0
  11. package/_bundles/{ordering-ui.a228aa8797d9d0fc5a6c.js → ordering-ui.3861d1cf52cf041c74c5.js} +2 -2
  12. package/_bundles/{ordering-ui.a228aa8797d9d0fc5a6c.js.LICENSE.txt → ordering-ui.3861d1cf52cf041c74c5.js.LICENSE.txt} +0 -0
  13. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +36 -28
  14. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +48 -34
  15. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -1
  16. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +9 -2
  17. package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +1 -1
  18. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -1
  19. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
  20. package/_modules/themes/five/src/components/Cart/index.js +73 -25
  21. package/_modules/themes/five/src/components/CartContent/index.js +3 -1
  22. package/_modules/themes/five/src/components/Checkout/index.js +25 -15
  23. package/_modules/themes/five/src/components/DriverTips/index.js +26 -15
  24. package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +63 -0
  25. package/_modules/themes/five/src/components/GiftCard/GiftCardUI/styles.js +27 -0
  26. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +69 -0
  27. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +29 -0
  28. package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +123 -0
  29. package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/styles.js +20 -0
  30. package/_modules/themes/five/src/components/GiftCard/SendGiftCard/index.js +114 -0
  31. package/_modules/themes/five/src/components/GiftCard/SendGiftCard/styles.js +14 -0
  32. package/_modules/themes/five/src/components/HorizontalOrdersLayout/index.js +3 -1
  33. package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
  34. package/_modules/themes/five/src/components/LoginForm/index.js +6 -0
  35. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +69 -0
  36. package/_modules/themes/five/src/components/OrderDetails/index.js +84 -76
  37. package/_modules/themes/five/src/components/OrderDetails/styles.js +1 -1
  38. package/_modules/themes/five/src/components/OrderItAgain/styles.js +3 -3
  39. package/_modules/themes/five/src/components/OrderProgress/index.js +5 -14
  40. package/_modules/themes/five/src/components/PaymentOptions/index.js +22 -8
  41. package/_modules/themes/five/src/components/PaymentOptions/styles.js +9 -7
  42. package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +20 -14
  43. package/_modules/themes/five/src/components/ProfessionalFilter/index.js +23 -25
  44. package/_modules/themes/five/src/components/ProfessionalFilter/styles.js +6 -32
  45. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +38 -22
  46. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +3 -9
  47. package/_modules/themes/five/src/components/ServiceForm/index.js +10 -4
  48. package/_modules/themes/five/src/components/ServiceForm/styles.js +23 -25
  49. package/_modules/themes/five/src/components/SignUpForm/index.js +6 -0
  50. package/_modules/themes/five/src/components/SingleOrderCard/index.js +22 -16
  51. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -2
  52. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +73 -51
  53. package/_modules/themes/five/src/components/SingleProfessionalCard/index.js +23 -7
  54. package/_modules/themes/five/src/components/SingleProfessionalCard/styles.js +29 -10
  55. package/_modules/themes/five/src/components/Wallets/index.js +2 -1
  56. package/package.json +2 -2
  57. package/src/themes/five/src/components/BusinessBasicInformation/index.js +49 -35
  58. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +26 -4
  59. package/src/themes/five/src/components/BusinessItemAccordion/index.js +1 -1
  60. package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -2
  61. package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +2 -2
  62. package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -0
  63. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +1 -1
  64. package/src/themes/five/src/components/Cart/index.js +44 -14
  65. package/src/themes/five/src/components/CartContent/index.js +1 -0
  66. package/src/themes/five/src/components/Checkout/index.js +67 -51
  67. package/src/themes/five/src/components/DriverTips/index.js +52 -40
  68. package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +59 -0
  69. package/src/themes/five/src/components/GiftCard/GiftCardUI/styles.js +41 -0
  70. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +70 -0
  71. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +52 -0
  72. package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +122 -0
  73. package/src/themes/five/src/components/GiftCard/RedeemGiftCard/styles.js +41 -0
  74. package/src/themes/five/src/components/GiftCard/SendGiftCard/index.js +103 -0
  75. package/src/themes/five/src/components/GiftCard/SendGiftCard/styles.js +27 -0
  76. package/src/themes/five/src/components/HorizontalOrdersLayout/index.js +7 -4
  77. package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +0 -1
  78. package/src/themes/five/src/components/LoginForm/index.js +7 -0
  79. package/src/themes/five/src/components/OrderDetails/OrderEta.js +59 -0
  80. package/src/themes/five/src/components/OrderDetails/index.js +141 -133
  81. package/src/themes/five/src/components/OrderDetails/styles.js +0 -1
  82. package/src/themes/five/src/components/OrderItAgain/styles.js +6 -6
  83. package/src/themes/five/src/components/OrderProgress/index.js +3 -12
  84. package/src/themes/five/src/components/PaymentOptions/index.js +26 -5
  85. package/src/themes/five/src/components/PaymentOptions/styles.js +4 -0
  86. package/src/themes/five/src/components/ProductOptionSubOption/styles.js +24 -4
  87. package/src/themes/five/src/components/ProfessionalFilter/index.js +18 -30
  88. package/src/themes/five/src/components/ProfessionalFilter/styles.js +1 -57
  89. package/src/themes/five/src/components/RenderProductsLayout/index.js +33 -17
  90. package/src/themes/five/src/components/RenderProductsLayout/styles.js +0 -18
  91. package/src/themes/five/src/components/ServiceForm/index.js +11 -5
  92. package/src/themes/five/src/components/ServiceForm/styles.js +1 -9
  93. package/src/themes/five/src/components/SignUpForm/index.js +7 -0
  94. package/src/themes/five/src/components/SingleOrderCard/index.js +43 -26
  95. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +12 -2
  96. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +51 -4
  97. package/src/themes/five/src/components/SingleProfessionalCard/index.js +17 -6
  98. package/src/themes/five/src/components/SingleProfessionalCard/styles.js +33 -6
  99. 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 showOrderActions = order?.delivery_type !== 1
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 showDeliveryType = !orderingTheme?.theme?.confirmation?.components?.order?.components?.delivery_type?.hidden
134
- const showDeliveryDate = !orderingTheme?.theme?.confirmation?.components?.order?.components?.date?.hidden
135
- const showDeliveryProgress = !orderingTheme?.theme?.confirmation?.components?.order?.components?.progress?.hidden
136
- const showBusinessPhone = !orderingTheme?.theme?.confirmation?.components?.business?.components?.phone?.hidden
137
- const showBusinessMessages = !orderingTheme?.theme?.confirmation?.components?.business?.components?.messages?.hidden
138
- const showBusinessEmail = !orderingTheme?.theme?.confirmation?.components?.business?.components?.email?.hidden
139
- const showBusinessAddress = !orderingTheme?.theme?.confirmation?.components?.business?.components?.address?.hidden
140
- const showBusinessMap = !orderingTheme?.theme?.confirmation?.components?.business?.components?.map?.hidden
141
- const showDriverName = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.name?.hidden
142
- const showDriverPhone = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.phone?.hidden
143
- const showDriverMessages = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.messages?.hidden
144
- const showDriverEmail = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.email?.hidden
145
- const showDriverPhoto = !orderingTheme?.theme?.confirmation?.components?.driver?.components?.photo?.hidden
146
- const showCustomerPhone = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.phone?.hidden
147
- const showCustomerAddress = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.address?.hidden
148
- const showCustomerEmail = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.email?.hidden
149
- const showCustomerPhoto = !orderingTheme?.theme?.confirmation?.components?.customer?.components?.photo?.hidden
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
- {showDeliveryType && (
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
- {showDeliveryDate && (
422
+ {!hideDeliveryDate && (
418
423
  <p className='date'>
419
- {
420
- order?.delivery_datetime_utc
421
- ? parseDate(order?.delivery_datetime_utc)
422
- : parseDate(order?.delivery_datetime, { utc: false })
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
- {showDeliveryProgress && (
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
- <OrderBusiness>
482
- <BusinessExternalWrapper>
483
- <BusinessWrapper
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
- <BtsOrderStatus>
542
- <div>
543
- <Button
544
- style={{ fontSize: 14 }}
545
- color={order?.status === 20 ? 'secundary' : 'primary'}
546
- onClick={() => handleChangeOrderStatus(20)}
547
- disabled={disableLeftButton.includes(order?.status)}
548
- >
549
- {getOrderStatus(20)?.value}
550
- </Button>
551
- </div>
552
- <div>
553
- <Button
554
- style={{ fontSize: 14 }}
555
- color={order?.status === 20 ? 'primary' : 'secundary'}
556
- disabled={disableRightButton.includes(order?.status)}
557
- onClick={() => handleChangeOrderStatus(21)}
558
- >
559
- {getOrderStatus(21)?.value}
560
- </Button>
561
- </div>
562
- </BtsOrderStatus>
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
- </BusinessExternalWrapper>
566
- {googleMapsApiKey && showBusinessMap && (
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
- {showCustomerPhoto && order?.customer?.photo && (
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
- {showCustomerEmail && (
589
+ {!hideCustomerEmail && (
589
590
  <p>{order?.customer?.email}</p>
590
591
  )}
591
- {showCustomerPhone && (
592
+ {!hideCustomerPhone && (
592
593
  <p>{order?.customer?.cellphone || order?.customer?.phone}</p>
593
594
  )}
594
- {showCustomerAddress && (
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={showDriverPhone}
609
- showMessages={showDriverMessages}
609
+ showPhone={!hideDriverPhone}
610
+ showMessages={!hideDriverMessages}
610
611
  />
611
612
  </SectionTitleContainer>
612
613
  <WrapperDriver>
613
- {showDriverPhoto && (
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
- {showDriverName && (
624
+ {!hideDriverName && (
624
625
  <h2>{order?.driver?.name} {order?.driver?.lastname}</h2>
625
626
  )}
626
- {showDriverEmail && (
627
+ {!hideDriverEmail && (
627
628
  <p>{order?.driver?.email}</p>
628
629
  )}
629
- {showDriverPhone && (
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
 
@@ -90,7 +90,6 @@ export const BusinessWrapper = styled.div`
90
90
  }
91
91
  }
92
92
  @media (min-width: 400px) {
93
- flex-direction: row;
94
93
  width: ${props => props.w ?? '100%'};
95
94
  }
96
95
  `
@@ -1,8 +1,8 @@
1
1
  import styled, { css } from 'styled-components'
2
2
 
3
3
  export const Container = styled.div`
4
- padding-top: 30px;
5
- margin-right: 30px;
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: 27px;
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, parseDate, parseTime }] = useUtils()
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
  &nbsp;-&nbsp;
105
- {convertDiffToHours(lastOrder.eta_time)}
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
- {stripeDirectMethods?.includes(isOpenMethod?.paymethod?.gateway) && (
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}
@@ -14,6 +14,10 @@ export const PaymentMethodsList = styled.div`
14
14
  margin-left: -15px;
15
15
  `
16
16
 
17
+ export const Container = styled.div`
18
+ margin: 0 auto;
19
+ `
20
+
17
21
  export const PayCard = styled.div`
18
22
  width: calc(50% - 30px);
19
23
  cursor: pointer;
@@ -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: 3px;
95
+ margin-right: 6px;
96
96
  ${props => props.theme?.rtl && css`
97
- margin-left: 3px;
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: 3px;
114
+ margin-left: 6px;
108
115
  margin-right: 0;
109
116
  ${props => props.theme?.rtl && css`
110
- margin-right: 3px;
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
  `