Merged in fix/SW-2138-include-hotel-content-in-destination-city-page (pull request #1733)

fix(SW-2138): include hotel content descriptions in hotel data retrieval

* fix(SW-2138): include hotel content descriptions in hotel data retrieval

* fix(SW-2136 ): simplify hotel description handling

* refactor(SW-2136): replace Body component with Typography for hotel descriptions in HotelListingItem


Approved-by: Christian Andolf
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-04-04 12:18:06 +00:00
parent 275a2b48a6
commit 02cae62e57
3 changed files with 10 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ import {
MaterialIcon,
TripadvisorIcon,
} from "@scandic-hotels/design-system/Icons"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { useDestinationPageHotelsMapStore } from "@/stores/destination-page-hotels-map"
@@ -17,7 +18,6 @@ import { FacilityToIcon } from "@/components/ContentType/HotelPage/data"
import ImageGallery from "@/components/ImageGallery"
import Button from "@/components/TempDesignSystem/Button"
import Divider from "@/components/TempDesignSystem/Divider"
import Body from "@/components/TempDesignSystem/Text/Body"
import Caption from "@/components/TempDesignSystem/Text/Caption"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import { mapApiImagesToGalleryImages } from "@/utils/imageGallery"
@@ -84,7 +84,11 @@ export default function HotelListingItem(data: DestinationPagesHotelData) {
</Caption>
</div>
</div>
<Body>{hotel.hotelContent?.texts.descriptions?.short}</Body>
{hotel.hotelDescription ? (
<Typography variant="Body/Paragraph/mdRegular">
<p>{hotel.hotelDescription}</p>
</Typography>
) : null}
<ul className={styles.amenityList}>
{amenities.map((amenity) => {
const Icon = (

View File

@@ -699,10 +699,11 @@ export const destinationPagesHotelDataSchema = z
.optional(),
}),
})
.transform(({ data: { ...data } }) => {
.transform(({ data: { hotelContent, ...data } }) => {
return {
hotel: {
...data,
hotelDescription: hotelContent?.texts.descriptions?.short,
},
url: data.url ?? "",
}

View File

@@ -563,9 +563,10 @@ export async function getHotelsByHotelIds({
type: hotel.type,
address: hotel.address,
cityIdentifier: cities?.[0]?.cityIdentifier,
hotelDescription: hotel.hotelContent?.texts.descriptions?.short,
},
url: hotelPage?.url ?? "",
} satisfies DestinationPagesHotelData
}
return { ...data, url: hotelPage?.url ?? null }
})