diff --git a/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Accessibility/index.tsx b/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Accessibility/index.tsx index 988201e7c..595544ef7 100644 --- a/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Accessibility/index.tsx +++ b/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Accessibility/index.tsx @@ -1,8 +1,11 @@ +import { accessibilitySubPage } from "@/constants/routes/hotelSubpages" + import { ArrowRightIcon } from "@/components/Icons" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" import Link from "@/components/TempDesignSystem/Link" import Body from "@/components/TempDesignSystem/Text/Body" import { getIntl } from "@/i18n" +import { getLang } from "@/i18n/serverContext" import styles from "./accessibilityAmenity.module.css" @@ -10,9 +13,12 @@ import type { AccessibilityAmenityProps } from "@/types/components/hotelPage/sid import { IconName } from "@/types/components/icon" export default async function AccessibilityAmenity({ - accessibility, + elevatorPitch, + hasExtraAccessibilityPage, }: AccessibilityAmenityProps) { const intl = await getIntl() + const lang = getLang() + return (
- {accessibility?.description && ( - {accessibility.description} + {elevatorPitch && ( + {elevatorPitch} )} - {accessibility?.link && ( + {hasExtraAccessibilityPage && ( {intl.formatMessage({ id: "About accessibility" })} diff --git a/components/ContentType/HotelPage/SidePeeks/Amenities/index.tsx b/components/ContentType/HotelPage/SidePeeks/Amenities/index.tsx index 7d233dfa6..889348620 100644 --- a/components/ContentType/HotelPage/SidePeeks/Amenities/index.tsx +++ b/components/ContentType/HotelPage/SidePeeks/Amenities/index.tsx @@ -70,8 +70,12 @@ export default async function AmenitiesSidePeek({ /> )} - {accessibility && ( - + {(accessibility.elevatorPitch || + accessibility.hasExtraAccessibilityPage) && ( + )} diff --git a/components/ContentType/HotelPage/index.tsx b/components/ContentType/HotelPage/index.tsx index b098471cf..5a9b1b94f 100644 --- a/components/ContentType/HotelPage/index.tsx +++ b/components/ContentType/HotelPage/index.tsx @@ -88,6 +88,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) { gallery, hotelParking, displayWebPage, + hotelSpecialNeeds, } = hotelData.additionalData const images = gallery?.smallerImages @@ -217,7 +218,10 @@ export default async function HotelPage({ hotelId }: HotelPageProps) { hasExtraParkingPage: displayWebPage.parking, }} checkInInformation={hotelFacts.checkin} - accessibility={hotelFacts.hotelInformation.accessibility} + accessibility={{ + elevatorPitch: hotelSpecialNeeds.elevatorPitch, + hasExtraAccessibilityPage: displayWebPage.specialNeeds, + }} restaurants={restaurants} /> li::before { + content: url("/_static/icons/heart.svg"); + position: relative; + height: 8px; + top: 3px; + margin-right: var(--Spacing-x1); +} diff --git a/components/ContentType/HotelSubpage/AdditionalContent/Accessibility/index.tsx b/components/ContentType/HotelSubpage/AdditionalContent/Accessibility/index.tsx new file mode 100644 index 000000000..d88827665 --- /dev/null +++ b/components/ContentType/HotelSubpage/AdditionalContent/Accessibility/index.tsx @@ -0,0 +1,40 @@ +import Body from "@/components/TempDesignSystem/Text/Body" +import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" + +import styles from "./accessibilityAdditionalContent.module.css" + +import type { AdditionalData } from "@/types/hotel" + +interface AccessibilityAdditionalContentProps { + additionalData: AdditionalData +} + +export default function AccessibilityAdditionalContent({ + additionalData, +}: AccessibilityAdditionalContentProps) { + return ( +
+ {additionalData.specialNeedGroups.map((accessibilityGroup) => ( +
+ +

{accessibilityGroup.name}

+
+
    + {accessibilityGroup.specialNeeds.map((groupItem) => ( + +
  • + {groupItem.details + ? `${groupItem.name}: ${groupItem.details}` + : groupItem.name} +
  • + + ))} +
+
+ ))} +
+ ) +} diff --git a/components/ContentType/HotelSubpage/AdditionalContent/ParkingAdditionalContent.tsx b/components/ContentType/HotelSubpage/AdditionalContent/Parking/index.tsx similarity index 90% rename from components/ContentType/HotelSubpage/AdditionalContent/ParkingAdditionalContent.tsx rename to components/ContentType/HotelSubpage/AdditionalContent/Parking/index.tsx index 10ee675cf..92e7ceab5 100644 --- a/components/ContentType/HotelSubpage/AdditionalContent/ParkingAdditionalContent.tsx +++ b/components/ContentType/HotelSubpage/AdditionalContent/Parking/index.tsx @@ -1,6 +1,6 @@ import ParkingInformation from "@/components/ParkingInformation" -import styles from "./additionalContent.module.css" +import styles from "./parkingAdditionalContent.module.css" import type { Hotel } from "@/types/hotel" diff --git a/components/ContentType/HotelSubpage/AdditionalContent/additionalContent.module.css b/components/ContentType/HotelSubpage/AdditionalContent/Parking/parkingAdditionalContent.module.css similarity index 100% rename from components/ContentType/HotelSubpage/AdditionalContent/additionalContent.module.css rename to components/ContentType/HotelSubpage/AdditionalContent/Parking/parkingAdditionalContent.module.css diff --git a/components/ContentType/HotelSubpage/AdditionalContent/index.tsx b/components/ContentType/HotelSubpage/AdditionalContent/index.tsx index ca86c1a2b..fa7900426 100644 --- a/components/ContentType/HotelSubpage/AdditionalContent/index.tsx +++ b/components/ContentType/HotelSubpage/AdditionalContent/index.tsx @@ -1,22 +1,26 @@ import { + accessibilitySubPage, parkingSubPage, wellnessSubPage, } from "@/constants/routes/hotelSubpages" import { getLang } from "@/i18n/serverContext" -import ParkingAdditionalContent from "./ParkingAdditionalContent" +import AccessibilityAdditionalContent from "./Accessibility" +import ParkingAdditionalContent from "./Parking" -import type { Hotel } from "@/types/hotel" +import type { AdditionalData, Hotel } from "@/types/hotel" interface HotelSubpageAdditionalContentProps { subpage: string hotel: Hotel + additionalData: AdditionalData } export default function HotelSubpageAdditionalContent({ subpage, hotel, + additionalData, }: HotelSubpageAdditionalContentProps) { const lang = getLang() @@ -25,6 +29,8 @@ export default function HotelSubpageAdditionalContent({ return case wellnessSubPage[lang]: return null + case accessibilitySubPage[lang]: + return default: return null } diff --git a/components/ContentType/HotelSubpage/Sidebar/index.tsx b/components/ContentType/HotelSubpage/Sidebar/index.tsx index acbbd9865..d466e3a23 100644 --- a/components/ContentType/HotelSubpage/Sidebar/index.tsx +++ b/components/ContentType/HotelSubpage/Sidebar/index.tsx @@ -1,4 +1,5 @@ import { + accessibilitySubPage, parkingSubPage, wellnessSubPage, } from "@/constants/routes/hotelSubpages" @@ -25,6 +26,8 @@ export default function HotelSubpageSidebar({ return case wellnessSubPage[lang]: return + case accessibilitySubPage[lang]: + return null default: return null } diff --git a/components/ContentType/HotelSubpage/index.tsx b/components/ContentType/HotelSubpage/index.tsx index 508a6065d..b49ef9941 100644 --- a/components/ContentType/HotelSubpage/index.tsx +++ b/components/ContentType/HotelSubpage/index.tsx @@ -63,7 +63,9 @@ export default async function HotelSubpage({
- {pageData.heading} + + {pageData.heading} + {pageData.elevatorPitch}
@@ -72,6 +74,7 @@ export default async function HotelSubpage({
diff --git a/components/ContentType/HotelSubpage/utils.ts b/components/ContentType/HotelSubpage/utils.ts index 30ffc4d75..66339d2dd 100644 --- a/components/ContentType/HotelSubpage/utils.ts +++ b/components/ContentType/HotelSubpage/utils.ts @@ -1,4 +1,5 @@ import { + accessibilitySubPage, parkingSubPage, wellnessSubPage, } from "@/constants/routes/hotelSubpages" @@ -44,6 +45,23 @@ export function getSubpageData( } : null, } + case accessibilitySubPage[lang]: + const accessibilityImage = additionalData.accessibility?.heroImages[0] + return { + ...additionalData.hotelSpecialNeeds, + heading: intl.formatMessage( + { id: "Accessibility at {hotel}" }, + { + hotel: hotel.name, + } + ), + heroImage: accessibilityImage + ? { + src: accessibilityImage.imageSizes.medium, + alt: accessibilityImage.metaData.altText || "", + } + : null, + } default: return null } diff --git a/constants/routes/hotelSubpages.ts b/constants/routes/hotelSubpages.ts index db52c1fb8..c7e5de78d 100644 --- a/constants/routes/hotelSubpages.ts +++ b/constants/routes/hotelSubpages.ts @@ -15,3 +15,12 @@ export const wellnessSubPage = { fi: "spa", de: "Wellness", } + +export const accessibilitySubPage = { + en: "accessibility", + sv: "tillganglighet", + no: "tilgjengelighet", + da: "tilgaengelighed", + fi: "saavutettavuus", + de: "barrierefreiheit", +} diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 530d23810..217e7bcd0 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -12,6 +12,7 @@ "About the hotel": "Om hotellet", "Accept new price": "Accepter ny pris", "Accessibility": "Tilgængelighed", + "Accessibility at {hotel}": "Tilgængelighed på {hotel}", "Accessible Room": "Tilgængelighedsrum", "Active": "Aktiv", "Activities": "Aktiviteter", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 1f641ddbc..58ebc29a7 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -12,6 +12,7 @@ "About the hotel": "Über das Hotel", "Accept new price": "Neuen Preis akzeptieren", "Accessibility": "Zugänglichkeit", + "Accessibility at {hotel}": "Barrierefreiheit im {hotel}", "Accessible Room": "Barrierefreies Zimmer", "Active": "Aktiv", "Activities": "Aktivitäten", diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index d116650e6..cd5676904 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -12,6 +12,7 @@ "About the hotel": "About the hotel", "Accept new price": "Accept new price", "Accessibility": "Accessibility", + "Accessibility at {hotel}": "Accessibility at {hotel}", "Accessible Room": "Accessibility room", "Active": "Active", "Activities": "Activities", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index 39f3cb523..ada837233 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -12,6 +12,7 @@ "About the hotel": "Tietoja hotellista", "Accept new price": "Hyväksy uusi hinta", "Accessibility": "Saavutettavuus", + "Accessibility at {hotel}": "Esteettömyys {hotel}", "Accessible Room": "Esteetön huone", "Active": "Aktiivinen", "Activities": "Aktiviteetit", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index 8736c3e93..13ecf92f5 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -12,6 +12,7 @@ "About the hotel": "Om hotellet", "Accept new price": "Aksepterer ny pris", "Accessibility": "Tilgjengelighet", + "Accessibility at {hotel}": "Tilgjengelighet på {hotel}", "Accessible Room": "Tilgjengelighetsrom", "Active": "Aktiv", "Activities": "Aktiviteter", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index 09ab58a7a..0364c2ea7 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -12,6 +12,7 @@ "About the hotel": "Om hotellet", "Accept new price": "Accepter ny pris", "Accessibility": "Tillgänglighet", + "Accessibility at {hotel}": "Tillgänglighet på {hotel}", "Accessible Room": "Tillgänglighetsrum", "Active": "Aktiv", "Activities": "Aktiviteter", diff --git a/server/routers/hotels/schemas/additionalData.ts b/server/routers/hotels/schemas/additionalData.ts index b2b3ecc53..ac4908d9b 100644 --- a/server/routers/hotels/schemas/additionalData.ts +++ b/server/routers/hotels/schemas/additionalData.ts @@ -34,6 +34,11 @@ export const extraPageSchema = z.object({ mainBody: z.string().optional(), }) +export const accessibilitySchema = z.object({ + headingText: z.string().default(""), + heroImages: z.array(imageSchema), +}) + export const additionalDataSchema = z.object({ attributes: z.object({ name: z.string(), @@ -56,6 +61,7 @@ export const additionalDataSchema = z.object({ hotelParking: extraPageSchema, hotelSpecialNeeds: extraPageSchema, hotelRoomElevatorPitchText: z.string().optional(), + accessibility: accessibilitySchema.optional(), }), type: z.literal("additionalData"), }) diff --git a/types/components/hotelPage/sidepeek/accessibility.ts b/types/components/hotelPage/sidepeek/accessibility.ts index 335971419..baebeb503 100644 --- a/types/components/hotelPage/sidepeek/accessibility.ts +++ b/types/components/hotelPage/sidepeek/accessibility.ts @@ -1,5 +1,4 @@ -import type { Hotel } from "@/types/hotel" - export type AccessibilityAmenityProps = { - accessibility: Hotel["hotelFacts"]["hotelInformation"]["accessibility"] + elevatorPitch?: string + hasExtraAccessibilityPage: boolean } diff --git a/types/components/hotelPage/sidepeek/amenities.ts b/types/components/hotelPage/sidepeek/amenities.ts index b090a2e6e..68a474bee 100644 --- a/types/components/hotelPage/sidepeek/amenities.ts +++ b/types/components/hotelPage/sidepeek/amenities.ts @@ -1,11 +1,12 @@ import type { Hotel, Restaurant, RestaurantOpeningHours } from "@/types/hotel" +import type { AccessibilityAmenityProps } from "./accessibility" import type { ParkingAmenityProps } from "./parking" export type AmenitiesSidePeekProps = { amenitiesList: Hotel["detailedFacilities"] parking: ParkingAmenityProps checkInInformation: Hotel["hotelFacts"]["checkin"] - accessibility: Hotel["hotelFacts"]["hotelInformation"]["accessibility"] + accessibility: AccessibilityAmenityProps restaurants: Restaurant[] }