From f0dbf294d89ad51beb2d0b259aa58851e04614c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?=
Date: Tue, 29 Apr 2025 10:20:47 +0200
Subject: [PATCH] feat(SW-2532): update room sidepeek amenities
---
.../HotelPage/SidePeeks/Room/index.tsx | 31 ++++++++++-------
.../HotelPage/SidePeeks/Room/room.module.css | 4 ---
.../BookedRoomSidePeek/RoomDetails.tsx | 33 ++++++++++++++-----
3 files changed, 43 insertions(+), 25 deletions(-)
diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/index.tsx
index 752e46a48..89f46c0f5 100644
--- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/index.tsx
+++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/index.tsx
@@ -104,25 +104,32 @@ export default async function RoomSidePeek({
{room.roomFacilities
+ .filter((facility) => !!facility.isUniqueSellingPoint)
.sort((a, b) => a.sortOrder - b.sortOrder)
.map((facility) => {
- const Icon = (
-
- )
+ const facilityName = facility.availableInAllRooms
+ ? facility.name
+ : intl.formatMessage(
+ {
+ defaultMessage: "{facility} (available in some rooms)",
+ },
+ {
+ facility: facility.name,
+ }
+ )
+
return (
-
- {Icon && Icon}
+
- {facility.name}
+ {facilityName}
)
diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/room.module.css b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/room.module.css
index 8067df657..87843f876 100644
--- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/room.module.css
+++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/Room/room.module.css
@@ -45,10 +45,6 @@
justify-content: flex-start;
}
-.noIcon {
- margin-left: var(--Spacing-x4);
-}
-
.buttonContainer {
background-color: var(--Base-Background-Primary-Normal);
border-top: 1px solid var(--Base-Border-Subtle);
diff --git a/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/RoomDetails.tsx b/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/RoomDetails.tsx
index 5dcffa19d..966239d72 100644
--- a/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/RoomDetails.tsx
+++ b/apps/scandic-web/components/SidePeeks/BookedRoomSidePeek/RoomDetails.tsx
@@ -19,7 +19,8 @@ export default function RoomDetails({
}: RoomDetailsProps) {
const intl = useIntl()
- const sortedFacilities = roomFacilities
+ const filteredSortedFacilities = roomFacilities
+ .filter((facility) => !!facility.isUniqueSellingPoint)
.sort((a, b) => a.sortOrder - b.sortOrder)
.map((facility) => {
const Icon =
@@ -45,14 +46,28 @@ export default function RoomDetails({
- {sortedFacilities.map(({ name, Icon }) => (
- -
- {Icon && Icon}
-
- {name}
-
-
- ))}
+ {filteredSortedFacilities.map(
+ ({ name, Icon, availableInAllRooms }) => (
+ -
+ {Icon}
+
+
+ {availableInAllRooms
+ ? name
+ : intl.formatMessage(
+ {
+ defaultMessage:
+ "{facility} (available in some rooms)",
+ },
+ {
+ facility: name,
+ }
+ )}
+
+
+
+ )
+ )}