Merged in fix/SW-1145-occupancy-room-api-change (pull request #1148)
Fix/SW-1145 occupancy room api change * fix(SW-1145): change occupancy to min and max * fix(SW-1145): small edit * fix(SW-1145): refactor to transform total room occupancy * fix(SW-1145): remove space * fix(SW-1145): small fix * fix(SW-1145): change to max for readability Approved-by: Erik Tiekstra Approved-by: Linus Flood
This commit is contained in:
committed by
Linus Flood
parent
1018b3ebcd
commit
a620be9331
@@ -16,7 +16,7 @@ import styles from "./roomCard.module.css"
|
||||
import type { RoomCardProps } from "@/types/components/hotelPage/room"
|
||||
|
||||
export function RoomCard({ room }: RoomCardProps) {
|
||||
const { images, name, roomSize, occupancy } = room
|
||||
const { images, name, roomSize, totalOccupancy } = room
|
||||
const intl = useIntl()
|
||||
|
||||
const size =
|
||||
@@ -46,7 +46,11 @@ export function RoomCard({ room }: RoomCardProps) {
|
||||
<Body color="grey">
|
||||
{intl.formatMessage(
|
||||
{ id: "hotelPages.rooms.roomCard.persons" },
|
||||
{ size, totalOccupancy: occupancy.total }
|
||||
{
|
||||
size,
|
||||
max: totalOccupancy.max,
|
||||
range: totalOccupancy.range,
|
||||
}
|
||||
)}
|
||||
</Body>
|
||||
</div>
|
||||
|
||||
@@ -17,9 +17,8 @@ import type { RoomSidePeekProps } from "@/types/components/hotelPage/sidepeek/ro
|
||||
|
||||
export default async function RoomSidePeek({ room }: RoomSidePeekProps) {
|
||||
const intl = await getIntl()
|
||||
const { roomSize, occupancy, descriptions, images } = room
|
||||
const { roomSize, totalOccupancy, descriptions, images } = room
|
||||
const roomDescription = descriptions.medium
|
||||
const totalOccupancy = occupancy.total
|
||||
// TODO: Not defined where this should lead.
|
||||
const ctaUrl = ""
|
||||
|
||||
@@ -34,7 +33,7 @@ export default async function RoomSidePeek({ room }: RoomSidePeekProps) {
|
||||
m².{" "}
|
||||
{intl.formatMessage(
|
||||
{ id: "booking.accommodatesUpTo" },
|
||||
{ nrOfGuests: totalOccupancy }
|
||||
{ range: totalOccupancy.range, max: totalOccupancy.max }
|
||||
)}
|
||||
</Body>
|
||||
<div className={styles.imageContainer}>
|
||||
|
||||
@@ -85,7 +85,7 @@ export default function RoomCard({
|
||||
)
|
||||
)
|
||||
|
||||
const { name, roomSize, occupancy, images } = selectedRoom || {}
|
||||
const { name, roomSize, totalOccupancy, images } = selectedRoom || {}
|
||||
|
||||
const freeCancelation = intl.formatMessage({ id: "Free cancellation" })
|
||||
const nonRefundable = intl.formatMessage({ id: "Non-refundable" })
|
||||
@@ -150,13 +150,13 @@ export default function RoomCard({
|
||||
</div>
|
||||
|
||||
<div className={styles.specification}>
|
||||
{occupancy?.total && (
|
||||
{totalOccupancy && (
|
||||
<Caption color="uiTextMediumContrast" className={styles.guests}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: "booking.guests",
|
||||
},
|
||||
{ nrOfGuests: occupancy.total }
|
||||
{ max: totalOccupancy.max, range: totalOccupancy.range }
|
||||
)}
|
||||
</Caption>
|
||||
)}
|
||||
|
||||
@@ -21,7 +21,6 @@ export default function RoomSidePeek({
|
||||
const intl = useIntl()
|
||||
|
||||
const roomSize = room.roomSize
|
||||
const occupancy = room.occupancy.total
|
||||
const roomDescription = room.descriptions.medium
|
||||
const images = room.images
|
||||
|
||||
@@ -40,7 +39,7 @@ export default function RoomSidePeek({
|
||||
m².{" "}
|
||||
{intl.formatMessage(
|
||||
{ id: "booking.accommodatesUpTo" },
|
||||
{ nrOfGuests: occupancy }
|
||||
{ max: room.totalOccupancy.max, range: room.totalOccupancy.range }
|
||||
)}
|
||||
</Body>
|
||||
<div className={styles.imageContainer}>
|
||||
|
||||
Reference in New Issue
Block a user