Merged in feat/SW-1573-subpage-url (pull request #1297)
Feat(SW-1573): Use pageInUrl for hotel subpages * feat(SW-1573): use pageInUrl for hotel subpages Approved-by: Erik Tiekstra Approved-by: Fredrik Thorsson
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
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"
|
||||
|
||||
@@ -14,10 +11,9 @@ import { IconName } from "@/types/components/icon"
|
||||
|
||||
export default async function AccessibilityAmenity({
|
||||
elevatorPitch,
|
||||
hasExtraAccessibilityPage,
|
||||
accessibilityPageUrl,
|
||||
}: AccessibilityAmenityProps) {
|
||||
const intl = await getIntl()
|
||||
const lang = getLang()
|
||||
|
||||
return (
|
||||
<AccordionItem
|
||||
@@ -30,9 +26,9 @@ export default async function AccessibilityAmenity({
|
||||
{elevatorPitch && (
|
||||
<Body color="uiTextHighContrast">{elevatorPitch}</Body>
|
||||
)}
|
||||
{hasExtraAccessibilityPage && (
|
||||
{accessibilityPageUrl && (
|
||||
<Link
|
||||
href={`/${accessibilitySubPage[lang]}`}
|
||||
href={`/${accessibilityPageUrl}`}
|
||||
color="burgundy"
|
||||
textDecoration="underline"
|
||||
variant="icon"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { parkingSubPage } from "@/constants/routes/hotelSubpages"
|
||||
|
||||
import ParkingInformation from "@/components/ParkingInformation"
|
||||
import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import { getIntl } from "@/i18n"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
|
||||
import styles from "./parkingAmenity.module.css"
|
||||
|
||||
@@ -15,9 +12,8 @@ import { IconName } from "@/types/components/icon"
|
||||
export default async function ParkingAmenity({
|
||||
parking,
|
||||
parkingElevatorPitch,
|
||||
hasExtraParkingPage,
|
||||
parkingPageUrl,
|
||||
}: ParkingAmenityProps) {
|
||||
const lang = getLang()
|
||||
const intl = await getIntl()
|
||||
|
||||
return (
|
||||
@@ -32,16 +28,15 @@ export default async function ParkingAmenity({
|
||||
{parking.map((data) => (
|
||||
<ParkingInformation key={data.type} parking={data} />
|
||||
))}
|
||||
{hasExtraParkingPage && (
|
||||
{parkingPageUrl && (
|
||||
<Button
|
||||
className={styles.parkingPageLink}
|
||||
theme="base"
|
||||
intent="secondary"
|
||||
asChild
|
||||
>
|
||||
{/* TODO: URL Should possibly be something more dynamic */}
|
||||
<Link
|
||||
href={`/${parkingSubPage[lang]}`}
|
||||
href={`/${parkingPageUrl}`}
|
||||
color="burgundy"
|
||||
weight="bold"
|
||||
appendToCurrentPath
|
||||
|
||||
@@ -61,7 +61,7 @@ export default async function AmenitiesSidePeek({
|
||||
<ParkingAmenity
|
||||
parking={parking.parking}
|
||||
parkingElevatorPitch={parking.parkingElevatorPitch}
|
||||
hasExtraParkingPage={parking.hasExtraParkingPage}
|
||||
parkingPageUrl={parking.parkingPageUrl}
|
||||
/>
|
||||
{breakfastOpeningHours && (
|
||||
<BreakfastAmenity
|
||||
@@ -71,9 +71,9 @@ export default async function AmenitiesSidePeek({
|
||||
)}
|
||||
<CheckInAmenity checkInInformation={checkInInformation} />
|
||||
{(accessibility.elevatorPitch ||
|
||||
accessibility.hasExtraAccessibilityPage) && (
|
||||
accessibility.accessibilityPageUrl) && (
|
||||
<AccessibilityAmenity
|
||||
hasExtraAccessibilityPage={accessibility.hasExtraAccessibilityPage}
|
||||
accessibilityPageUrl={accessibility.accessibilityPageUrl}
|
||||
elevatorPitch={accessibility.elevatorPitch}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { wellnessAndExercise } from "@/constants/routes/hotelPageParams"
|
||||
import { wellnessSubPage } from "@/constants/routes/hotelSubpages"
|
||||
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
@@ -15,7 +14,7 @@ import type { WellnessAndExerciseSidePeekProps } from "@/types/components/hotelP
|
||||
|
||||
export default async function WellnessAndExerciseSidePeek({
|
||||
healthFacilities,
|
||||
wellnessExerciseButton = false,
|
||||
wellnessExercisePageUrl,
|
||||
spaPage,
|
||||
}: WellnessAndExerciseSidePeekProps) {
|
||||
const intl = await getIntl()
|
||||
@@ -31,7 +30,7 @@ export default async function WellnessAndExerciseSidePeek({
|
||||
<Facility key={facility.type} data={facility} />
|
||||
))}
|
||||
</div>
|
||||
{(spaPage || wellnessExerciseButton) && (
|
||||
{(spaPage || wellnessExercisePageUrl) && (
|
||||
<div className={styles.buttonContainer}>
|
||||
{spaPage && (
|
||||
<Button fullWidth theme="base" intent="tertiary" asChild>
|
||||
@@ -40,10 +39,10 @@ export default async function WellnessAndExerciseSidePeek({
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
{wellnessExerciseButton && (
|
||||
{wellnessExercisePageUrl && (
|
||||
<Button fullWidth theme="base" intent="secondary" asChild>
|
||||
<Link
|
||||
href={`/${wellnessSubPage[lang]}`}
|
||||
href={`/${wellnessExercisePageUrl}`}
|
||||
weight="bold"
|
||||
color="burgundy"
|
||||
appendToCurrentPath
|
||||
|
||||
@@ -82,6 +82,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
const roomCategories = hotelData.roomCategories
|
||||
const {
|
||||
healthAndWellness,
|
||||
healthAndFitness,
|
||||
restaurantImages,
|
||||
conferencesAndMeetings,
|
||||
hotelRoomElevatorPitchText,
|
||||
@@ -217,12 +218,16 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
parking={{
|
||||
parking: parking,
|
||||
parkingElevatorPitch: hotelParking.elevatorPitch,
|
||||
hasExtraParkingPage: displayWebPage.parking,
|
||||
parkingPageUrl: displayWebPage.parking
|
||||
? hotelParking.nameInUrl
|
||||
: undefined,
|
||||
}}
|
||||
checkInInformation={hotelFacts.checkin}
|
||||
accessibility={{
|
||||
elevatorPitch: hotelSpecialNeeds.elevatorPitch,
|
||||
hasExtraAccessibilityPage: displayWebPage.specialNeeds,
|
||||
accessibilityPageUrl: displayWebPage.specialNeeds
|
||||
? hotelSpecialNeeds.nameInUrl
|
||||
: undefined,
|
||||
}}
|
||||
restaurants={restaurants}
|
||||
/>
|
||||
@@ -237,7 +242,9 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
|
||||
<WellnessAndExerciseSidePeek
|
||||
healthFacilities={healthFacilities}
|
||||
spaPage={spaPage?.spa_page}
|
||||
wellnessExerciseButton={displayWebPage.healthGym}
|
||||
wellnessExercisePageUrl={
|
||||
displayWebPage.healthGym ? healthAndFitness.nameInUrl : undefined
|
||||
}
|
||||
/>
|
||||
<RestaurantBarSidePeek restaurants={restaurants} />
|
||||
{activitiesCards.map((card) => (
|
||||
|
||||
Reference in New Issue
Block a user