From ec0c6234ef7cf05c270e5e173551b6de9fe83e0f Mon Sep 17 00:00:00 2001 From: Bianca Widstam Date: Fri, 13 Dec 2024 10:21:59 +0000 Subject: [PATCH] Merged in fix/SW-1119-select-room-same-currency (pull request #1075) fix(SW-1119): remove approx currency if same and synchronize price option height * fix(SW-1119): remove approx currency if same and synchronize price option height * fix(SW-1119): use debounce and observer for performance * fix(SW-1119): export selector variable to utils Approved-by: Pontus Dreij Approved-by: Niclas Edenvin --- .../FlexibilityOption/PriceList/index.tsx | 32 ++++---- .../RoomSelection/FlexibilityOption/index.tsx | 11 ++- .../SelectRate/RoomSelection/index.tsx | 76 +++++++++++++++++-- .../SelectRate/RoomSelection/utils.ts | 2 + 4 files changed, 95 insertions(+), 26 deletions(-) diff --git a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceList/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceList/index.tsx index a201a44b1..eff2e3717 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceList/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceList/index.tsx @@ -28,7 +28,10 @@ export default function PriceList({ const petRoomLocalPrice = petRoomPackage?.localPrice const petRoomRequestedPrice = petRoomPackage?.requestedPrice - const showRequestedPrice = publicRequestedPrice && memberRequestedPrice + const showRequestedPrice = + publicRequestedPrice && + memberRequestedPrice && + publicRequestedPrice.currency !== publicLocalPrice.currency const searchParams = useSearchParams() const fromDate = searchParams.get("fromDate") const toDate = searchParams.get("toDate") @@ -114,27 +117,22 @@ export default function PriceList({ )} - -
-
- - {intl.formatMessage({ id: "Approx." })} - -
-
- {showRequestedPrice ? ( + {showRequestedPrice && ( +
+
+ + {intl.formatMessage({ id: "Approx." })} + +
+
{totalPublicRequestedPricePerNight}/ {totalMemberRequestedPricePerNight}{" "} {publicRequestedPrice.currency} - ) : ( - - / - EUR - )} -
-
+ + + )} ) } diff --git a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/index.tsx index 1a227d568..5e13bd1e9 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/index.tsx @@ -7,6 +7,7 @@ import Label from "@/components/TempDesignSystem/Form/Label" import Popover from "@/components/TempDesignSystem/Popover" import Caption from "@/components/TempDesignSystem/Text/Caption" +import { rateCardEqualHeightSelector } from "../utils" import PriceTable from "./PriceList" import styles from "./flexibilityOption.module.css" @@ -26,11 +27,13 @@ export default function FlexibilityOption({ if (!product) { return ( -
+
- {name} - ({paymentTerm}) +
+ {name} + ({paymentTerm}) +