From 4002d63c5976b10ad65b4bdcf78bc302a885c7ea Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Fri, 15 Nov 2024 14:21:52 +0100 Subject: [PATCH] feat(SW-880): update facility type rendering --- .../HotelPage/SidePeeks/Utils/getType.ts | 29 ------------- .../SidePeeks/WellnessAndExercise/index.tsx | 42 ++++++++++--------- i18n/dictionaries/da.json | 4 +- i18n/dictionaries/de.json | 4 +- i18n/dictionaries/en.json | 4 +- i18n/dictionaries/fi.json | 4 +- i18n/dictionaries/no.json | 4 +- i18n/dictionaries/sv.json | 4 +- .../hotelPage/sidepeek/wellnessAndExercise.ts | 1 + 9 files changed, 35 insertions(+), 61 deletions(-) delete mode 100644 components/ContentType/HotelPage/SidePeeks/Utils/getType.ts diff --git a/components/ContentType/HotelPage/SidePeeks/Utils/getType.ts b/components/ContentType/HotelPage/SidePeeks/Utils/getType.ts deleted file mode 100644 index 1a6f87a63..000000000 --- a/components/ContentType/HotelPage/SidePeeks/Utils/getType.ts +++ /dev/null @@ -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 - } -} diff --git a/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx b/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx index dee9d73e1..5314e3f18 100644 --- a/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx +++ b/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx @@ -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({
{healthFacilities.map((facility) => (
- {facility.content.images[0]?.metaData.altText} + {facility.content.images[0]?.imageSizes.medium && ( + {facility.content.images[0].metaData.altText + )}
- {getFacilityType(facility.type)} + + {intl.formatMessage({ id: `${facility.type}` })} +
@@ -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}`} - - {/* TODO: Determine what details should be displayed about the facility type */} -
))}
-
- -
+ {buttonUrl && ( +
+ +
+ )} ) } diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 14c46b7be..c453589ea 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -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", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 403f0db22..04d750494 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -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", diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index 2bb99e5f2..09cf02ec9 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -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", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index bfaa69ec6..64903ea74 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -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", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index b593f1c83..ef15b0823 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -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", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index 05c775020..8be596fc1 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -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", diff --git a/types/components/hotelPage/sidepeek/wellnessAndExercise.ts b/types/components/hotelPage/sidepeek/wellnessAndExercise.ts index a75499f2d..828f3ee8b 100644 --- a/types/components/hotelPage/sidepeek/wellnessAndExercise.ts +++ b/types/components/hotelPage/sidepeek/wellnessAndExercise.ts @@ -2,4 +2,5 @@ import type { Hotel } from "@/types/hotel" export type WellnessAndExerciseSidePeekProps = { healthFacilities: Hotel["healthFacilities"] + buttonUrl?: string }