feat(Sw-713): conditional rendering
This commit is contained in:
@@ -57,6 +57,7 @@ export default function RoomCard({
|
|||||||
const selectedRoom = roomCategories.find(
|
const selectedRoom = roomCategories.find(
|
||||||
(room) => room.name === roomConfiguration.roomType
|
(room) => room.name === roomConfiguration.roomType
|
||||||
)
|
)
|
||||||
|
|
||||||
const { roomSize, occupancy, descriptions, images } = selectedRoom || {}
|
const { roomSize, occupancy, descriptions, images } = selectedRoom || {}
|
||||||
const mainImage = images?.[0]
|
const mainImage = images?.[0]
|
||||||
|
|
||||||
@@ -78,7 +79,9 @@ export default function RoomCard({
|
|||||||
: `${roomSize?.min}-${roomSize?.max}`}
|
: `${roomSize?.min}-${roomSize?.max}`}
|
||||||
m²
|
m²
|
||||||
</Caption>
|
</Caption>
|
||||||
<RoomSidePeek selectedRoom={selectedRoom} buttonSize="small" />
|
{selectedRoom && (
|
||||||
|
<RoomSidePeek selectedRoom={selectedRoom} buttonSize="small" />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={styles.roomDetails}>
|
<div className={styles.roomDetails}>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { RoomData } from "@/types/hotel"
|
import { RoomData } from "@/types/hotel"
|
||||||
|
|
||||||
export type RoomSidePeekProps = {
|
export type RoomSidePeekProps = {
|
||||||
selectedRoom?: RoomData
|
selectedRoom: RoomData
|
||||||
buttonSize: "small" | "medium"
|
buttonSize: "small" | "medium"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user