From 77eabac038eca0dcfa161cccb287c41ad3d30000 Mon Sep 17 00:00:00 2001 From: Anton Gunnarsson Date: Fri, 30 Jan 2026 08:29:35 +0000 Subject: [PATCH] Merged in fix/loy-589-update-cancellation-labels (pull request #3495) fix(LOY-589): Split cancellation label into two * Split cancellation label into two * Fix copy Approved-by: Bianca Widstam --- .../Rooms/SingleRoom/Details/ModifyBy.tsx | 38 +++++++++++-------- .../BookingConfirmation/Rooms/Room/index.tsx | 13 +++++-- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Details/ModifyBy.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Details/ModifyBy.tsx index 79cc435d9..bcc6736cc 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Details/ModifyBy.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Details/ModifyBy.tsx @@ -1,11 +1,11 @@ import { useIntl } from "react-intl" +import { CancellationRuleEnum } from "@scandic-hotels/common/constants/booking" import { changeOrCancelDateFormat } from "@scandic-hotels/common/constants/dateFormats" import { dt } from "@scandic-hotels/common/dt" import { useMyStayStore } from "@/stores/my-stay" -import { hasModifiableRate } from "@/components/HotelReservation/MyStay/utils" import useLang from "@/hooks/useLang" import Row from "./Row" @@ -14,14 +14,19 @@ export default function ModifyBy() { const intl = useIntl() const lang = useLang() - const { checkInDate, isModifyable } = useMyStayStore((state) => ({ - checkInDate: state.bookedRoom.checkInDate, - isModifyable: hasModifiableRate( - state.bookedRoom.rateDefinition.cancellationRule - ), - })) + const { checkInDate, isFlexBooking, isChangeBooking } = useMyStayStore( + (state) => ({ + checkInDate: state.bookedRoom.checkInDate, + isFlexBooking: + state.bookedRoom.rateDefinition.cancellationRule === + CancellationRuleEnum.CancellableBefore6PM, + isChangeBooking: + state.bookedRoom.rateDefinition.cancellationRule === + CancellationRuleEnum.Changeable, + }) + ) - if (!isModifyable) { + if (!isFlexBooking && !isChangeBooking) { return null } @@ -38,14 +43,15 @@ export default function ModifyBy() { } ) - return ( - - ) + }) + + return } diff --git a/packages/booking-flow/lib/components/BookingConfirmation/Rooms/Room/index.tsx b/packages/booking-flow/lib/components/BookingConfirmation/Rooms/Room/index.tsx index 39068b0b1..894655a60 100644 --- a/packages/booking-flow/lib/components/BookingConfirmation/Rooms/Room/index.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/Rooms/Room/index.tsx @@ -198,10 +198,15 @@ export function Room({ {isFlexBooking || isChangeBooking ? (
  • - {intl.formatMessage({ - id: "booking.changeOrCancel", - defaultMessage: "Change or cancel", - })} + {isChangeBooking + ? intl.formatMessage({ + id: "booking.changeTitle", + defaultMessage: "Change", + }) + : intl.formatMessage({ + id: "booking.changeOrCancel", + defaultMessage: "Change or cancel", + })}

    {intl.formatMessage(