From fa7d94093e63c164075359a0fff928b7bc1b9af3 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Fri, 16 May 2025 08:32:54 +0000 Subject: [PATCH] Merged in feat/SW-2612-mystay-breakfast-buffet-u (pull request #2059) Feat: SW-2612 Updated breakfast ancillary UI and Optimised code * Feat: SW-2612 Updated breakfast ancillary UI and Optimised code * feat: SW-2612 Updated UI as per figma * feat: SW-2612 Optimised code * feat: SW-2612 Optimised code Approved-by: Tobias Johansson --- .../ActionButtons/actionButtons.module.css | 4 +- .../ActionButtons/index.tsx | 24 +++---- .../PriceDetails/PriceSummary/index.tsx | 5 +- .../PriceDetails/index.tsx | 68 ++++++++++++++++++- .../PriceDetails/priceDetails.module.css | 18 ++++- .../Steps/SelectQuantityStep/index.tsx | 4 -- .../AddAncillaryFlowModal/index.tsx | 22 +++--- .../addedAncillaries.module.css | 1 - .../Ancillaries/AddedAncillaries/index.tsx | 5 +- 9 files changed, 113 insertions(+), 38 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/actionButtons.module.css b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/actionButtons.module.css index 875ee841b..f5822f169 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/actionButtons.module.css +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/actionButtons.module.css @@ -2,12 +2,12 @@ display: flex; gap: var(--Spacing-x4); justify-content: flex-end; - padding: var(--Space-x2) var(--Space-x15) 0; + padding: var(--Space-x2) var(--Space-x15) 0 0; } .confirmButtons { display: flex; - padding: 0 var(--Space-x15); + padding-left: var(--Space-x15); justify-content: space-between; align-items: baseline; } diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/index.tsx index 892548b18..782d21eae 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/ActionButtons/index.tsx @@ -25,6 +25,7 @@ export default function ActionButtons({ }: ActionButtonsProps) { const { currentStep, + isBreakfast, prevStep, prevStepMobile, selectQuantity, @@ -33,6 +34,7 @@ export default function ActionButtons({ selectedAncillary, } = useAddAncillaryStore((state) => ({ currentStep: state.currentStep, + isBreakfast: state.isBreakfast, prevStep: state.prevStep, prevStepMobile: state.prevStepMobile, selectQuantity: state.selectQuantity, @@ -96,19 +98,13 @@ export default function ActionButtons({ {intl.formatMessage({ defaultMessage: "Price details", })} - {isPriceDetailsOpen ? ( - - ) : ( - - )} + )}
@@ -140,7 +136,7 @@ export default function ActionButtons({
- {isPriceDetailsOpen && ( + {isPriceDetailsOpen && currentStep === AncillaryStepEnum.confirmation && ( state.breakfastData) - const { setValue } = useFormContext() - - setValue("quantityWithCard", 1) - if (!breakfastData) { return intl.formatMessage({ defaultMessage: "Can not show breakfast prices.", diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx index bfedf19ba..3b04010a3 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddAncillaryFlow/AddAncillaryFlowModal/index.tsx @@ -91,7 +91,8 @@ export default function AddAncillaryFlowModal({ const formMethods = useForm({ defaultValues: { quantityWithPoints: null, - quantityWithCard: !user || hasInsufficientPoints ? 1 : null, + quantityWithCard: + !user || hasInsufficientPoints || isBreakfast ? 1 : null, deliveryTime: defaultDeliveryTime, optionalText: "", termsAndConditions: false, @@ -357,17 +358,17 @@ export default function AddAncillaryFlowModal({
-

- {isBreakfast ? ( - - ) : ( - formatPrice( + {isBreakfast ? ( + + ) : ( +

+ {formatPrice( intl, selectedAncillary.price.total, selectedAncillary.price.currency - ) - )} -

+ )} +

+ )}
{selectedAncillary.points && (
@@ -406,7 +407,8 @@ export default function AddAncillaryFlowModal({ {currentStep === AncillaryStepEnum.selectAncillary ? null : (
+
- + ) })}