feat(SW-880): update facility type rendering

This commit is contained in:
Fredrik Thorsson
2024-11-15 14:21:52 +01:00
parent 5377a43f56
commit 4002d63c59
9 changed files with 35 additions and 61 deletions

View File

@@ -1,29 +0,0 @@
import { getIntl } from "@/i18n"
export async function getFacilityType(type: string) {
const intl = await getIntl()
const outdoorPool = intl.formatMessage({ id: "Outdoor pool" })
const indoorPool = intl.formatMessage({ id: "Indoor pool" })
const sauna = intl.formatMessage({ id: "Sauna" })
const relax = intl.formatMessage({ id: "Relax" })
const gym = intl.formatMessage({ id: "Gym" })
const jacuzzi = intl.formatMessage({ id: "Jacuzzi" })
switch (type) {
case "OutdoorPool":
return outdoorPool
case "IndoorPool":
return indoorPool
case "Sauna":
return sauna
case "Relax":
return relax
case "Gym":
return gym
case "Jacuzzi":
return jacuzzi
default:
return type
}
}

View File

@@ -10,14 +10,13 @@ import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n" import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext" import { getLang } from "@/i18n/serverContext"
import { getFacilityType } from "../Utils/getType"
import styles from "./wellnessAndExercise.module.css" import styles from "./wellnessAndExercise.module.css"
import type { WellnessAndExerciseSidePeekProps } from "@/types/components/hotelPage/sidepeek/wellnessAndExercise" import type { WellnessAndExerciseSidePeekProps } from "@/types/components/hotelPage/sidepeek/wellnessAndExercise"
export default async function WellnessAndExerciseSidePeek({ export default async function WellnessAndExerciseSidePeek({
healthFacilities, healthFacilities,
buttonUrl,
}: WellnessAndExerciseSidePeekProps) { }: WellnessAndExerciseSidePeekProps) {
const intl = await getIntl() const intl = await getIntl()
const lang = getLang() const lang = getLang()
@@ -30,16 +29,20 @@ export default async function WellnessAndExerciseSidePeek({
<div className={styles.wrapper}> <div className={styles.wrapper}>
{healthFacilities.map((facility) => ( {healthFacilities.map((facility) => (
<div className={styles.content} key={facility.type}> <div className={styles.content} key={facility.type}>
<Image {facility.content.images[0]?.imageSizes.medium && (
src={facility.content.images[0]?.imageSizes.large} <Image
alt={facility.content.images[0]?.metaData.altText} src={facility.content.images[0].imageSizes.medium}
className={styles.image} alt={facility.content.images[0].metaData.altText || ""}
height={400} className={styles.image}
width={200} height={400}
/> width={200}
/>
)}
<div className={styles.information}> <div className={styles.information}>
<Subtitle color="burgundy" asChild type="one"> <Subtitle color="burgundy" asChild type="one">
<Title level="h3">{getFacilityType(facility.type)}</Title> <Title level="h3">
{intl.formatMessage({ id: `${facility.type}` })}
</Title>
</Subtitle> </Subtitle>
<div> <div>
<Subtitle type="two" color="uiTextHighContrast"> <Subtitle type="two" color="uiTextHighContrast">
@@ -55,21 +58,20 @@ export default async function WellnessAndExerciseSidePeek({
? `${intl.formatMessage({ id: "Sat-Sun" })} ${intl.formatMessage({ id: "Always open" })}` ? `${intl.formatMessage({ id: "Sat-Sun" })} ${intl.formatMessage({ id: "Always open" })}`
: `${intl.formatMessage({ id: "Sat-Sun" })} ${facility.openingDetails.openingHours.weekends.openingTime}-${facility.openingDetails.openingHours.weekends.closingTime}`} : `${intl.formatMessage({ id: "Sat-Sun" })} ${facility.openingDetails.openingHours.weekends.openingTime}-${facility.openingDetails.openingHours.weekends.closingTime}`}
</Body> </Body>
<Body>
{/* TODO: Determine what details should be displayed about the facility type */}
</Body>
</div> </div>
</div> </div>
</div> </div>
))} ))}
</div> </div>
<div className={styles.buttonContainer}> {buttonUrl && (
<Button fullWidth theme="base" intent="secondary" asChild> <div className={styles.buttonContainer}>
<Link href="#" weight="bold" color="burgundy"> <Button fullWidth theme="base" intent="secondary" asChild>
{intl.formatMessage({ id: "Show wellness & exercise" })} <Link href={buttonUrl} weight="bold" color="burgundy">
</Link> {intl.formatMessage({ id: "Show wellness & exercise" })}
</Button> </Link>
</div> </Button>
</div>
)}
</SidePeek> </SidePeek>
) )
} }

View File

@@ -160,7 +160,7 @@
"In crib": "i tremmeseng", "In crib": "i tremmeseng",
"In extra bed": "i ekstra seng", "In extra bed": "i ekstra seng",
"Included": "Inkluderet", "Included": "Inkluderet",
"Indoor pool": "Indendørs pool", "IndoorPool": "Indendørs pool",
"It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Det er ikke muligt at administrere dine kommunikationspræferencer lige nu, prøv venligst igen senere eller kontakt support, hvis problemet fortsætter.", "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Det er ikke muligt at administrere dine kommunikationspræferencer lige nu, prøv venligst igen senere eller kontakt support, hvis problemet fortsætter.",
"Jacuzzi": "Jacuzzi", "Jacuzzi": "Jacuzzi",
"Join Scandic Friends": "Tilmeld dig Scandic Friends", "Join Scandic Friends": "Tilmeld dig Scandic Friends",
@@ -241,7 +241,7 @@
"Open menu": "Åbn menuen", "Open menu": "Åbn menuen",
"Open my pages menu": "Åbn mine sider menuen", "Open my pages menu": "Åbn mine sider menuen",
"Opening Hours": "Åbningstider", "Opening Hours": "Åbningstider",
"Outdoor pool": "Udendørs pool", "OutdoorPool": "Udendørs pool",
"Overview": "Oversigt", "Overview": "Oversigt",
"PETR": "Kæledyr", "PETR": "Kæledyr",
"Parking": "Parkering", "Parking": "Parkering",

View File

@@ -160,7 +160,7 @@
"In crib": "im Kinderbett", "In crib": "im Kinderbett",
"In extra bed": "im zusätzlichen Bett", "In extra bed": "im zusätzlichen Bett",
"Included": "Iinklusive", "Included": "Iinklusive",
"Indoor pool": "Innenpool", "IndoorPool": "Innenpool",
"It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Es ist derzeit nicht möglich, Ihre Kommunikationseinstellungen zu verwalten. Bitte versuchen Sie es später erneut oder wenden Sie sich an den Support, wenn das Problem weiterhin besteht.", "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Es ist derzeit nicht möglich, Ihre Kommunikationseinstellungen zu verwalten. Bitte versuchen Sie es später erneut oder wenden Sie sich an den Support, wenn das Problem weiterhin besteht.",
"Jacuzzi": "Whirlpool", "Jacuzzi": "Whirlpool",
"Join Scandic Friends": "Treten Sie Scandic Friends bei", "Join Scandic Friends": "Treten Sie Scandic Friends bei",
@@ -239,7 +239,7 @@
"Open menu": "Menü öffnen", "Open menu": "Menü öffnen",
"Open my pages menu": "Meine Seiten Menü öffnen", "Open my pages menu": "Meine Seiten Menü öffnen",
"Opening Hours": "Öffnungszeiten", "Opening Hours": "Öffnungszeiten",
"Outdoor pool": "Außenpool", "OutdoorPool": "Außenpool",
"Overview": "Übersicht", "Overview": "Übersicht",
"PETR": "Haustier", "PETR": "Haustier",
"Parking": "Parken", "Parking": "Parken",

View File

@@ -172,7 +172,7 @@
"In crib": "In crib", "In crib": "In crib",
"In extra bed": "In extra bed", "In extra bed": "In extra bed",
"Included": "Included", "Included": "Included",
"Indoor pool": "Indoor pool", "IndoorPool": "Indoor pool",
"It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.", "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.",
"Jacuzzi": "Jacuzzi", "Jacuzzi": "Jacuzzi",
"Join Scandic Friends": "Join Scandic Friends", "Join Scandic Friends": "Join Scandic Friends",
@@ -258,7 +258,7 @@
"Open menu": "Open menu", "Open menu": "Open menu",
"Open my pages menu": "Open my pages menu", "Open my pages menu": "Open my pages menu",
"Opening Hours": "Opening Hours", "Opening Hours": "Opening Hours",
"Outdoor pool": "Outdoor pool", "OutdoorPool": "Outdoor pool",
"Overview": "Overview", "Overview": "Overview",
"PETR": "Pet", "PETR": "Pet",
"Parking": "Parking", "Parking": "Parking",

View File

@@ -160,7 +160,7 @@
"In crib": "Pinnasängyssä", "In crib": "Pinnasängyssä",
"In extra bed": "Oma vuodepaikka", "In extra bed": "Oma vuodepaikka",
"Included": "Sisälly hintaan", "Included": "Sisälly hintaan",
"Indoor pool": "Sisäuima-allas", "IndoorPool": "Sisäuima-allas",
"It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Viestintäasetuksiasi ei voi hallita juuri nyt. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen, jos ongelma jatkuu.", "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Viestintäasetuksiasi ei voi hallita juuri nyt. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen, jos ongelma jatkuu.",
"Jacuzzi": "Poreallas", "Jacuzzi": "Poreallas",
"Join Scandic Friends": "Liity jäseneksi", "Join Scandic Friends": "Liity jäseneksi",
@@ -241,7 +241,7 @@
"Open menu": "Avaa valikko", "Open menu": "Avaa valikko",
"Open my pages menu": "Avaa omat sivut -valikko", "Open my pages menu": "Avaa omat sivut -valikko",
"Opening Hours": "Aukioloajat", "Opening Hours": "Aukioloajat",
"Outdoor pool": "Ulkouima-allas", "OutdoorPool": "Ulkouima-allas",
"Overview": "Yleiskatsaus", "Overview": "Yleiskatsaus",
"PETR": "Lemmikki", "PETR": "Lemmikki",
"Parking": "Pysäköinti", "Parking": "Pysäköinti",

View File

@@ -158,7 +158,7 @@
"In crib": "i sprinkelseng", "In crib": "i sprinkelseng",
"In extra bed": "i ekstraseng", "In extra bed": "i ekstraseng",
"Included": "Inkludert", "Included": "Inkludert",
"Indoor pool": "Innendørs basseng", "IndoorPool": "Innendørs basseng",
"It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Det er ikke mulig å administrere kommunikasjonspreferansene dine akkurat nå, prøv igjen senere eller kontakt support hvis problemet vedvarer.", "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Det er ikke mulig å administrere kommunikasjonspreferansene dine akkurat nå, prøv igjen senere eller kontakt support hvis problemet vedvarer.",
"Jacuzzi": "Boblebad", "Jacuzzi": "Boblebad",
"Join Scandic Friends": "Bli med i Scandic Friends", "Join Scandic Friends": "Bli med i Scandic Friends",
@@ -239,7 +239,7 @@
"Open menu": "Åpne menyen", "Open menu": "Åpne menyen",
"Open my pages menu": "Åpne mine sider menyen", "Open my pages menu": "Åpne mine sider menyen",
"Opening Hours": "Åpningstider", "Opening Hours": "Åpningstider",
"Outdoor pool": "Utendørs basseng", "OutdoorPool": "Utendørs basseng",
"Overview": "Oversikt", "Overview": "Oversikt",
"PETR": "Kjæledyr", "PETR": "Kjæledyr",
"Parking": "Parkering", "Parking": "Parkering",

View File

@@ -158,7 +158,7 @@
"In crib": "I spjälsäng", "In crib": "I spjälsäng",
"In extra bed": "Egen sängplats", "In extra bed": "Egen sängplats",
"Included": "Inkluderad", "Included": "Inkluderad",
"Indoor pool": "Inomhuspool", "IndoorPool": "Inomhuspool",
"It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Det gick inte att hantera dina kommunikationsinställningar just nu, försök igen senare eller kontakta supporten om problemet kvarstår.", "It is not posible to manage your communication preferences right now, please try again later or contact support if the problem persists.": "Det gick inte att hantera dina kommunikationsinställningar just nu, försök igen senare eller kontakta supporten om problemet kvarstår.",
"Jacuzzi": "Jacuzzi", "Jacuzzi": "Jacuzzi",
"Join Scandic Friends": "Gå med i Scandic Friends", "Join Scandic Friends": "Gå med i Scandic Friends",
@@ -239,7 +239,7 @@
"Open menu": "Öppna menyn", "Open menu": "Öppna menyn",
"Open my pages menu": "Öppna mina sidor menyn", "Open my pages menu": "Öppna mina sidor menyn",
"Opening Hours": "Öppettider", "Opening Hours": "Öppettider",
"Outdoor pool": "Utomhuspool", "OutdoorPool": "Utomhuspool",
"Overview": "Översikt", "Overview": "Översikt",
"PETR": "Husdjur", "PETR": "Husdjur",
"Parking": "Parkering", "Parking": "Parkering",

View File

@@ -2,4 +2,5 @@ import type { Hotel } from "@/types/hotel"
export type WellnessAndExerciseSidePeekProps = { export type WellnessAndExerciseSidePeekProps = {
healthFacilities: Hotel["healthFacilities"] healthFacilities: Hotel["healthFacilities"]
buttonUrl?: string
} }