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:
@@ -10,6 +10,7 @@ import {
|
|||||||
MaterialIcon,
|
MaterialIcon,
|
||||||
TripadvisorIcon,
|
TripadvisorIcon,
|
||||||
} from "@scandic-hotels/design-system/Icons"
|
} from "@scandic-hotels/design-system/Icons"
|
||||||
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
import { useDestinationPageHotelsMapStore } from "@/stores/destination-page-hotels-map"
|
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 ImageGallery from "@/components/ImageGallery"
|
||||||
import Button from "@/components/TempDesignSystem/Button"
|
import Button from "@/components/TempDesignSystem/Button"
|
||||||
import Divider from "@/components/TempDesignSystem/Divider"
|
import Divider from "@/components/TempDesignSystem/Divider"
|
||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
|
||||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||||
import { mapApiImagesToGalleryImages } from "@/utils/imageGallery"
|
import { mapApiImagesToGalleryImages } from "@/utils/imageGallery"
|
||||||
@@ -84,7 +84,11 @@ export default function HotelListingItem(data: DestinationPagesHotelData) {
|
|||||||
</Caption>
|
</Caption>
|
||||||
</div>
|
</div>
|
||||||
</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}>
|
<ul className={styles.amenityList}>
|
||||||
{amenities.map((amenity) => {
|
{amenities.map((amenity) => {
|
||||||
const Icon = (
|
const Icon = (
|
||||||
|
|||||||
@@ -699,10 +699,11 @@ export const destinationPagesHotelDataSchema = z
|
|||||||
.optional(),
|
.optional(),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
.transform(({ data: { ...data } }) => {
|
.transform(({ data: { hotelContent, ...data } }) => {
|
||||||
return {
|
return {
|
||||||
hotel: {
|
hotel: {
|
||||||
...data,
|
...data,
|
||||||
|
hotelDescription: hotelContent?.texts.descriptions?.short,
|
||||||
},
|
},
|
||||||
url: data.url ?? "",
|
url: data.url ?? "",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -563,9 +563,10 @@ export async function getHotelsByHotelIds({
|
|||||||
type: hotel.type,
|
type: hotel.type,
|
||||||
address: hotel.address,
|
address: hotel.address,
|
||||||
cityIdentifier: cities?.[0]?.cityIdentifier,
|
cityIdentifier: cities?.[0]?.cityIdentifier,
|
||||||
|
hotelDescription: hotel.hotelContent?.texts.descriptions?.short,
|
||||||
},
|
},
|
||||||
url: hotelPage?.url ?? "",
|
url: hotelPage?.url ?? "",
|
||||||
} satisfies DestinationPagesHotelData
|
}
|
||||||
|
|
||||||
return { ...data, url: hotelPage?.url ?? null }
|
return { ...data, url: hotelPage?.url ?? null }
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user