Merged in feat/SW-1974-handle-missing-data-hotel-page (pull request #2575)

Feat/SW-1974 handle missing data hotel page

* fix(SW-1974): adjust image gallery styling

* fix(SW-1974): add border radius to fullview image

* fix(SW-1974): handle no rooms

* fix(SW-1974): adjust amenity list

* fix(SW-1974): hide parking accordion if no data


Approved-by: Anton Gunnarsson
This commit is contained in:
Matilda Landström
2025-07-30 08:00:17 +00:00
parent 03c327b449
commit 216cb706ad
8 changed files with 66 additions and 49 deletions

View File

@@ -1,10 +1,9 @@
.amenitiesContainer { .amenitiesContainer {
background-color: var(--Base-Surface-Subtle-Normal); background-color: var(--Base-Surface-Subtle-Normal);
border-radius: var(--Corner-radius-lg); border-radius: var(--Corner-radius-lg);
padding: var(--Spacing-x3) var(--Spacing-x3) var(--Spacing-x-one-and-half) padding: var(--Space-x3) var(--Space-x3) var(--Space-x15) var(--Space-x3);
var(--Spacing-x3);
display: grid; display: grid;
gap: var(--Spacing-x-one-and-half); gap: var(--Space-x15);
height: fit-content; height: fit-content;
width: min(100%, 300px); width: min(100%, 300px);
justify-items: start; justify-items: start;
@@ -13,13 +12,12 @@
.amenityItemList { .amenityItemList {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--Spacing-x1); gap: var(--Space-x1);
} }
.amenityItem { .amenityItem {
display: inline-flex; display: inline-flex;
gap: var(--Spacing-x1); gap: var(--Space-x1);
align-items: center;
} }
.icon { .icon {
@@ -32,10 +30,11 @@
.facility { .facility {
color: var(--Text-Secondary); color: var(--Text-Secondary);
align-items: center;
} }
@media screen and (min-width: 1367px) { @media screen and (min-width: 1367px) {
.amenitiesContainer { .amenitiesContainer {
margin-top: var(--Spacing-x5); margin-top: var(--Space-x5);
} }
} }

View File

@@ -37,13 +37,12 @@ export default async function AmenitiesList({
) )
return ( return (
<div className={styles.amenityItem} key={facility.id}> <div className={styles.amenityItem} key={facility.id}>
{Icon && Icon} {Icon}
<Typography <span className={styles.facility}>
variant="Body/Paragraph/mdRegular" <Typography variant="Body/Paragraph/mdRegular">
className={styles.facility} <p>{facility.name}</p>
> </Typography>
<p>{facility.name}</p> </span>
</Typography>
</div> </div>
) )
})} })}

View File

@@ -15,13 +15,13 @@
cursor: pointer; cursor: pointer;
border-radius: var(--Corner-radius-sm); border-radius: var(--Corner-radius-sm);
overflow: hidden; overflow: hidden;
max-height: 30vh;
} }
.image { .image {
object-fit: cover; object-fit: cover;
width: 100%; width: 100%;
height: 100%; height: 100%;
max-height: 30vh;
margin: 0 auto; margin: 0 auto;
} }
@@ -32,42 +32,24 @@
.seeAllButton { .seeAllButton {
position: absolute; position: absolute;
bottom: var(--Spacing-x2); bottom: var(--Space-x2);
right: var(--Spacing-x4); right: var(--Space-x4);
z-index: 1; z-index: 1;
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.seeAllButton { .seeAllButton {
right: calc(var(--Spacing-x2) + var(--Layout-Tablet-Margin-Margin-min)); right: calc(var(--Space-x2) + var(--Layout-Tablet-Margin-Margin-min));
} }
} }
@media screen and (min-width: 1367px) { @media screen and (min-width: 1367px) {
.imageWrapper { .imageWrapper {
grid-template-columns: 70% 30%; padding: 0 var(--Space-x5);
grid-template-rows: repeat(2, 16.625rem);
grid-template-areas:
"main side1"
"main side2";
padding: 0 var(--Spacing-x5);
} }
.image { .imageButton {
max-height: none; max-height: 540px;
}
.imageWrapper > :first-child {
grid-area: main;
}
.imageWrapper > :nth-child(2),
.imageWrapper > :nth-child(3) {
display: initial;
}
.imageWrapper > :nth-child(2) {
grid-area: side1;
} }
.desktopGrid > :nth-child(3) { .desktopGrid > :nth-child(3) {
@@ -75,6 +57,31 @@
} }
.seeAllButton { .seeAllButton {
right: var(--Spacing-x7); right: var(--Space-x7);
}
.imageWrapper:has(> :nth-child(2)) {
grid-template-columns: 70% 30%;
grid-template-rows: repeat(2, 16.625rem);
grid-template-areas:
"main side1"
"main side2";
> :first-child {
grid-area: main;
}
> :nth-child(2),
> :nth-child(3) {
display: initial;
}
> :nth-child(2) {
grid-area: side1;
}
.imageButton {
max-height: none;
}
} }
} }

View File

@@ -123,6 +123,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
hasMeetingRooms: !!(meetingRoomsData && meetingRoomsData.length > 0), hasMeetingRooms: !!(meetingRoomsData && meetingRoomsData.length > 0),
hasActivities: activitiesCards.length > 0, hasActivities: activitiesCards.length > 0,
hasFAQ: !!(faq && faq.accordions.length > 0), hasFAQ: !!(faq && faq.accordions.length > 0),
hasRooms: roomCategories.length > 0,
}, },
sectionHeadings sectionHeadings
) )
@@ -194,11 +195,13 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
</div> </div>
) : null} ) : null}
</div> </div>
<Rooms {pageSections.rooms ? (
heading={pageSections.rooms.heading} <Rooms
rooms={roomCategories} heading={pageSections.rooms.heading}
preamble={hotelRoomElevatorPitchText} rooms={roomCategories}
/> preamble={hotelRoomElevatorPitchText}
/>
) : null}
{facilities && ( {facilities && (
<Facilities <Facilities
facilities={facilities} facilities={facilities}

View File

@@ -100,6 +100,7 @@ export function getPageSectionsData(
hasMeetingRooms: boolean hasMeetingRooms: boolean
hasActivities: boolean hasActivities: boolean
hasFAQ: boolean hasFAQ: boolean
hasRooms: boolean
}, },
sectionHeadings?: HotelPageSectionHeadings | null sectionHeadings?: HotelPageSectionHeadings | null
) { ) {
@@ -109,6 +110,7 @@ export function getPageSectionsData(
hasMeetingRooms, hasMeetingRooms,
hasActivities, hasActivities,
hasFAQ, hasFAQ,
hasRooms,
} = dynamicSections } = dynamicSections
const sections: HotelPageSections = { const sections: HotelPageSections = {
overview: { overview: {
@@ -119,16 +121,18 @@ export function getPageSectionsData(
defaultMessage: "Overview", defaultMessage: "Overview",
}), }),
}, },
rooms: { }
if (hasRooms) {
sections.rooms = {
hash: HotelHashValues.rooms, hash: HotelHashValues.rooms,
heading: heading:
sectionHeadings?.rooms || sectionHeadings?.rooms ||
intl.formatMessage({ intl.formatMessage({
defaultMessage: "Rooms", defaultMessage: "Rooms",
}), }),
}, }
} }
if (hasRestaurants) { if (hasRestaurants) {
sections.restaurant = { sections.restaurant = {
hash: HotelHashValues.restaurant, hash: HotelHashValues.restaurant,

View File

@@ -50,6 +50,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
border-radius: var(--Corner-radius-Medium);
} }
.imageCaption { .imageCaption {

View File

@@ -20,6 +20,10 @@ export default function ParkingAccordionItem({
}: ParkingAccordionItemProps) { }: ParkingAccordionItemProps) {
const intl = useIntl() const intl = useIntl()
if (!parking.length && !elevatorPitch && !parkingPageHref) {
return null
}
return ( return (
<AccordionItem <AccordionItem
title={intl.formatMessage({ title={intl.formatMessage({

View File

@@ -18,7 +18,7 @@ interface HotelPageSection {
export interface HotelPageSections { export interface HotelPageSections {
overview: HotelPageSection overview: HotelPageSection
rooms: HotelPageSection rooms?: HotelPageSection
restaurant?: HotelPageSection restaurant?: HotelPageSection
meetings?: HotelPageSection meetings?: HotelPageSection
wellness?: HotelPageSection wellness?: HotelPageSection