From 8e78dec6c27ec614c1fae7d5602350a59fd941f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Mon, 28 Apr 2025 09:27:36 +0000 Subject: [PATCH] Merged in feat/SW-1477-external-gym (pull request #1875) feat/SW-1477-handle-external-gym * feat/SW-1477-handle-external-gym Approved-by: Erik Tiekstra --- .../RestaurantBar/RestaurantBarItem/index.tsx | 5 +- .../Facility/facility.module.css | 4 + .../WellnessAndExercise/Facility/index.tsx | 106 ++++++++++-------- .../SidePeeks/WellnessAndExercise/index.tsx | 39 +++---- 4 files changed, 87 insertions(+), 67 deletions(-) diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/RestaurantBar/RestaurantBarItem/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/RestaurantBar/RestaurantBarItem/index.tsx index 1eb811d2b..441ea86ee 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/RestaurantBar/RestaurantBarItem/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/RestaurantBar/RestaurantBarItem/index.tsx @@ -5,7 +5,6 @@ import ButtonLink from "@/components/ButtonLink" import Image from "@/components/Image" import OpeningHours from "@/components/OpeningHours" import Link from "@/components/TempDesignSystem/Link" -import Body from "@/components/TempDesignSystem/Text/Body" import { getIntl } from "@/i18n" import styles from "./restaurantBarItem.module.css" @@ -50,7 +49,9 @@ export default async function RestaurantBarItem({ ))} ) : null} - {content.texts.descriptions.short} + +

{content.texts.descriptions.short}

+
{openingDetails.length ? (
diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/facility.module.css b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/facility.module.css index 22aea5bce..7aba30255 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/facility.module.css +++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/facility.module.css @@ -20,3 +20,7 @@ .openingHours { margin-top: var(--Spacing-x1); } + +.title { + color: var(--Text-Interactive-Default); +} diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx index f2109ea94..fcb3f2811 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/Facility/index.tsx @@ -1,7 +1,6 @@ +import { Typography } from "@scandic-hotels/design-system/Typography" + import Image from "@/components/Image" -import Body from "@/components/TempDesignSystem/Text/Body" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import { translateWellnessType } from "../../../utils" @@ -15,6 +14,10 @@ export default async function Facility({ data }: FacilityProps) { const image = data.content.images[0] const ordinaryOpeningTimes = data.openingDetails.openingHours.ordinary const weekendOpeningTimes = data.openingDetails.openingHours.weekends + const shortDescription = data.content.texts.descriptions?.short + const isExternalGym = + data.type === "Gym" && + data?.details.find((d) => d.name === "ExternalGym")?.value return (
@@ -28,50 +31,61 @@ export default async function Facility({ data }: FacilityProps) { /> )}
- - {translateWellnessType(data.type, intl)} - -
- - {intl.formatMessage({ - defaultMessage: "Opening hours", - })} - -
- - {ordinaryOpeningTimes.alwaysOpen - ? intl.formatMessage({ - defaultMessage: "Monday–Friday: Always open", - }) - : intl.formatMessage( - { - defaultMessage: - "Monday–Friday: {openingTime}–{closingTime}", - }, - { - openingTime: ordinaryOpeningTimes.openingTime, - closingTime: ordinaryOpeningTimes.closingTime, - } - )} - - - {weekendOpeningTimes.alwaysOpen - ? intl.formatMessage({ - defaultMessage: "Saturday–Sunday: Always open", - }) - : intl.formatMessage( - { - defaultMessage: - "Saturday–Sunday: {openingTime}–{closingTime}", - }, - { - openingTime: weekendOpeningTimes.openingTime, - closingTime: weekendOpeningTimes.closingTime, - } - )} - + +

{translateWellnessType(data.type, intl)}

+
+ {!isExternalGym ? ( +
+ +

+ {intl.formatMessage({ + defaultMessage: "Opening hours", + })} +

+
+ +
+

+ {ordinaryOpeningTimes.alwaysOpen + ? intl.formatMessage({ + defaultMessage: "Monday–Friday: Always open", + }) + : intl.formatMessage( + { + defaultMessage: + "Monday–Friday: {openingTime}–{closingTime}", + }, + { + openingTime: ordinaryOpeningTimes.openingTime, + closingTime: ordinaryOpeningTimes.closingTime, + } + )} +

+

+ {weekendOpeningTimes.alwaysOpen + ? intl.formatMessage({ + defaultMessage: "Saturday–Sunday: Always open", + }) + : intl.formatMessage( + { + defaultMessage: + "Saturday–Sunday: {openingTime}–{closingTime}", + }, + { + openingTime: weekendOpeningTimes.openingTime, + closingTime: weekendOpeningTimes.closingTime, + } + )} +

+
+
-
+ ) : null} + {shortDescription ? ( + +

{shortDescription}

+
+ ) : null}
) diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx index f5a4d1e06..9d7a2f8e4 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/WellnessAndExercise/index.tsx @@ -1,5 +1,4 @@ -import Button from "@/components/TempDesignSystem/Button" -import Link from "@/components/TempDesignSystem/Link" +import ButtonLink from "@/components/ButtonLink" import SidePeek from "@/components/TempDesignSystem/SidePeek" import { getIntl } from "@/i18n" @@ -32,25 +31,27 @@ export default async function WellnessAndExerciseSidePeek({ {(spaPage || wellnessExercisePageUrl) && (
{spaPage && ( - + + {spaPage.buttonCTA} + )} {wellnessExercisePageUrl && ( - + + {intl.formatMessage({ + defaultMessage: "Show Gym & Wellness", + })} + )}
)}