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

View File

@@ -160,7 +160,7 @@
"In crib": "i tremmeseng",
"In extra bed": "i ekstra seng",
"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.",
"Jacuzzi": "Jacuzzi",
"Join Scandic Friends": "Tilmeld dig Scandic Friends",
@@ -241,7 +241,7 @@
"Open menu": "Åbn menuen",
"Open my pages menu": "Åbn mine sider menuen",
"Opening Hours": "Åbningstider",
"Outdoor pool": "Udendørs pool",
"OutdoorPool": "Udendørs pool",
"Overview": "Oversigt",
"PETR": "Kæledyr",
"Parking": "Parkering",

View File

@@ -160,7 +160,7 @@
"In crib": "im Kinderbett",
"In extra bed": "im zusätzlichen Bett",
"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.",
"Jacuzzi": "Whirlpool",
"Join Scandic Friends": "Treten Sie Scandic Friends bei",
@@ -239,7 +239,7 @@
"Open menu": "Menü öffnen",
"Open my pages menu": "Meine Seiten Menü öffnen",
"Opening Hours": "Öffnungszeiten",
"Outdoor pool": "Außenpool",
"OutdoorPool": "Außenpool",
"Overview": "Übersicht",
"PETR": "Haustier",
"Parking": "Parken",

View File

@@ -172,7 +172,7 @@
"In crib": "In crib",
"In extra bed": "In extra bed",
"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.",
"Jacuzzi": "Jacuzzi",
"Join Scandic Friends": "Join Scandic Friends",
@@ -258,7 +258,7 @@
"Open menu": "Open menu",
"Open my pages menu": "Open my pages menu",
"Opening Hours": "Opening Hours",
"Outdoor pool": "Outdoor pool",
"OutdoorPool": "Outdoor pool",
"Overview": "Overview",
"PETR": "Pet",
"Parking": "Parking",

View File

@@ -160,7 +160,7 @@
"In crib": "Pinnasängyssä",
"In extra bed": "Oma vuodepaikka",
"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.",
"Jacuzzi": "Poreallas",
"Join Scandic Friends": "Liity jäseneksi",
@@ -241,7 +241,7 @@
"Open menu": "Avaa valikko",
"Open my pages menu": "Avaa omat sivut -valikko",
"Opening Hours": "Aukioloajat",
"Outdoor pool": "Ulkouima-allas",
"OutdoorPool": "Ulkouima-allas",
"Overview": "Yleiskatsaus",
"PETR": "Lemmikki",
"Parking": "Pysäköinti",

View File

@@ -158,7 +158,7 @@
"In crib": "i sprinkelseng",
"In extra bed": "i ekstraseng",
"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.",
"Jacuzzi": "Boblebad",
"Join Scandic Friends": "Bli med i Scandic Friends",
@@ -239,7 +239,7 @@
"Open menu": "Åpne menyen",
"Open my pages menu": "Åpne mine sider menyen",
"Opening Hours": "Åpningstider",
"Outdoor pool": "Utendørs basseng",
"OutdoorPool": "Utendørs basseng",
"Overview": "Oversikt",
"PETR": "Kjæledyr",
"Parking": "Parkering",

View File

@@ -158,7 +158,7 @@
"In crib": "I spjälsäng",
"In extra bed": "Egen sängplats",
"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.",
"Jacuzzi": "Jacuzzi",
"Join Scandic Friends": "Gå med i Scandic Friends",
@@ -239,7 +239,7 @@
"Open menu": "Öppna menyn",
"Open my pages menu": "Öppna mina sidor menyn",
"Opening Hours": "Öppettider",
"Outdoor pool": "Utomhuspool",
"OutdoorPool": "Utomhuspool",
"Overview": "Översikt",
"PETR": "Husdjur",
"Parking": "Parkering",

View File

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