From 343caed40c7113261816c2b6bcee5a638a95104e Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Tue, 6 May 2025 14:16:34 +0000 Subject: [PATCH] Merged in fix/SW-2402-hide-gla-rewardNight (pull request #1983) fix(SW-2042): hide guarantee late arrival on my stay for rewardNight * fix(SW-2042): hide guarantee late arrival on my stay for rewardNight Approved-by: Niclas Edenvin --- .../Actions/GuaranteeLateArrival/index.tsx | 10 ++++++++-- .../MyStay/ReferenceCard/GuaranteeInfo/index.tsx | 14 +++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/GuaranteeLateArrival/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/GuaranteeLateArrival/index.tsx index 011585fe2..1c9aa33b1 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/GuaranteeLateArrival/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/Actions/NotCancelled/ManageStay/Actions/GuaranteeLateArrival/index.tsx @@ -16,16 +16,22 @@ import styles from "./guarantee.module.css" export default function GuaranteeLateArrival() { const intl = useIntl() - const { checkInDate, checkInTime, guaranteeInfo, isCancelled } = + const { checkInDate, checkInTime, guaranteeInfo, isCancelled, priceType } = useMyStayStore((state) => ({ checkInDate: state.bookedRoom.checkInDate, checkInTime: state.hotel.hotelFacts.checkin.checkInTime, guaranteeInfo: state.bookedRoom.guaranteeInfo, isCancelled: state.bookedRoom.isCancelled, + priceType: state.bookedRoom.priceType, })) + const isRewardNight = priceType === "points" + const guaranteeable = - !guaranteeInfo && !isCancelled && !dateHasPassed(checkInDate, checkInTime) + !guaranteeInfo && + !isCancelled && + !dateHasPassed(checkInDate, checkInTime) && + !isRewardNight if (!guaranteeable) { return null diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/GuaranteeInfo/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/GuaranteeInfo/index.tsx index f260c0756..72f40f8c2 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/GuaranteeInfo/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/GuaranteeInfo/index.tsx @@ -10,12 +10,16 @@ import styles from "./guaranteeInfo.module.css" export default function GuaranteeInfo() { const intl = useIntl() - const { allRoomsAreCancelled, guaranteeInfo } = useMyStayStore((state) => ({ - allRoomsAreCancelled: state.allRoomsAreCancelled, - guaranteeInfo: state.bookedRoom.guaranteeInfo, - })) + const { allRoomsAreCancelled, guaranteeInfo, priceType } = useMyStayStore( + (state) => ({ + allRoomsAreCancelled: state.allRoomsAreCancelled, + guaranteeInfo: state.bookedRoom.guaranteeInfo, + priceType: state.bookedRoom.priceType, + }) + ) - if (allRoomsAreCancelled || !guaranteeInfo) { + const isRewardNight = priceType === "points" + if (allRoomsAreCancelled || (!guaranteeInfo && !isRewardNight)) { return null }