From 4106f9a91d216b73f47598b13a2a87cfc4ae0e0c Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Wed, 30 Oct 2024 12:56:53 +0100 Subject: [PATCH] feat(Sw-713): conditional rendering --- .../SelectRate/RoomSelection/RoomCard/index.tsx | 5 ++++- types/components/sidePeeks/roomSidePeek.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx index 7b0709ca9..07311f7fd 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/RoomCard/index.tsx @@ -57,6 +57,7 @@ export default function RoomCard({ const selectedRoom = roomCategories.find( (room) => room.name === roomConfiguration.roomType ) + const { roomSize, occupancy, descriptions, images } = selectedRoom || {} const mainImage = images?.[0] @@ -78,7 +79,9 @@ export default function RoomCard({ : `${roomSize?.min}-${roomSize?.max}`} m² - + {selectedRoom && ( + + )}
diff --git a/types/components/sidePeeks/roomSidePeek.ts b/types/components/sidePeeks/roomSidePeek.ts index 1ed03c522..c868d7ab3 100644 --- a/types/components/sidePeeks/roomSidePeek.ts +++ b/types/components/sidePeeks/roomSidePeek.ts @@ -1,6 +1,6 @@ import { RoomData } from "@/types/hotel" export type RoomSidePeekProps = { - selectedRoom?: RoomData + selectedRoom: RoomData buttonSize: "small" | "medium" }