Merged in feat/SW-1207-parking-teaser (pull request #1217)

Feat(SW-1207): Add parking elevator pitch to hotel sidepeek

* feat(SW-1207): Add parking elevator pitch to hotel sidepeek

* fix(SW-1207): remove optional from parking elevator pitch


Approved-by: Erik Tiekstra
Approved-by: Fredrik Thorsson
This commit is contained in:
Matilda Landström
2025-01-28 13:23:47 +00:00
parent 8d755071bc
commit 0dee660609
7 changed files with 26 additions and 10 deletions

View File

@@ -17,7 +17,8 @@ import { IconName } from "@/types/components/icon"
export default async function ParkingAmenity({
parking,
hasParkingPage,
parkingElevatorPitch,
hasExtraParkingPage,
}: ParkingAmenityProps) {
const intl = await getIntl()
@@ -29,6 +30,7 @@ export default async function ParkingAmenity({
trackingId="amenities:parking"
>
<div className={styles.wrapper}>
{parkingElevatorPitch}
{parking.map((data) => (
<div key={data.type} className={styles.information}>
<div className={styles.list}>
@@ -84,14 +86,14 @@ export default async function ParkingAmenity({
</div>
))}
</div>
{hasParkingPage && (
{hasExtraParkingPage && (
<Button
className={styles.parkingPageLink}
theme="base"
intent="secondary"
asChild
>
{/* Not decided how to handle linking to separate parking page */}
{/* TODO: Add URL to separate parking page */}
<Link href="#" color="burgundy" weight="bold">
{intl.formatMessage({ id: "About parking" })}
</Link>

View File

@@ -58,8 +58,11 @@ export default async function AmenitiesSidePeek({
title={intl.formatMessage({ id: "Amenities" })}
>
<Accordion>
{parking.length ? <ParkingAmenity parking={parking} /> : null}
<ParkingAmenity
parking={parking.parking}
parkingElevatorPitch={parking.parkingElevatorPitch}
hasExtraParkingPage={parking.hasExtraParkingPage}
/>
{breakfastOpeningHours && (
<BreakfastAmenity
openingHours={breakfastOpeningHours.openingHours}

View File

@@ -85,6 +85,8 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
conferencesAndMeetings,
hotelRoomElevatorPitchText,
gallery,
hotelParking,
displayWebPage,
} = additionalData
const images = gallery?.smallerImages
@@ -208,7 +210,11 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
<SidePeekProvider>
<AmenitiesSidePeek
amenitiesList={detailedFacilities}
parking={parking}
parking={{
parking: parking,
parkingElevatorPitch: hotelParking.elevatorPitch,
hasExtraParkingPage: displayWebPage.parking,
}}
checkInInformation={hotelFacts.checkin}
accessibility={hotelFacts.hotelInformation.accessibility}
restaurants={restaurants}

View File

@@ -29,8 +29,8 @@ export const restaurantsOverviewPageSchema = z.object({
restaurantsContentDescriptionMedium: z.string().optional(),
})
const extraPageSchema = z.object({
elevatorPitch: z.string().optional(),
export const extraPageSchema = z.object({
elevatorPitch: z.string(),
mainBody: z.string().optional(),
})

View File

@@ -3,10 +3,11 @@ import type {
RestaurantData,
RestaurantOpeningHours,
} from "@/types/hotel"
import type { ParkingAmenityProps } from "./parking"
export type AmenitiesSidePeekProps = {
amenitiesList: Hotel["detailedFacilities"]
parking: Hotel["parking"]
parking: ParkingAmenityProps
checkInInformation: Hotel["hotelFacts"]["checkin"]
accessibility: Hotel["hotelFacts"]["hotelInformation"]["accessibility"]
restaurants: RestaurantData[]

View File

@@ -8,7 +8,8 @@ export enum Periods {
export type ParkingAmenityProps = {
parking: Hotel["parking"]
hasParkingPage?: boolean
parkingElevatorPitch: string
hasExtraParkingPage: boolean
}
export type ParkingListProps = {

View File

@@ -8,6 +8,7 @@ import type {
} from "@/server/routers/hotels/output"
import type {
additionalDataSchema,
extraPageSchema,
facilitySchema,
} from "@/server/routers/hotels/schemas/additionalData"
import type { imageSchema } from "@/server/routers/hotels/schemas/image"
@@ -41,6 +42,8 @@ export type CheckInData = z.infer<typeof checkinSchema>
export type AdditionalData = z.infer<typeof additionalDataSchema>
export type ExtraPageSchema = z.infer<typeof extraPageSchema>
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
export enum PointOfInterestGroupEnum {