From 0383a332ad825fcf8e70a095c31610c7f120d022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Thu, 5 Jun 2025 07:29:49 +0000 Subject: [PATCH] Merged in feat/SW-2888-facilities (pull request #2267) Feat/SW-2888 facilities * chore(SW-2944): change order of content * chore(SW-2944): add openinghourstype from api Approved-by: Erik Tiekstra --- .../WellnessAndExercise/Facility/index.tsx | 17 ++++++++++------- .../hotels/schemas/hotel/healthFacilities.ts | 1 + .../types/components/hotelPage/facilities.ts | 5 +++++ 3 files changed, 16 insertions(+), 7 deletions(-) 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 054ce7498..e8c90a9ac 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 @@ -11,6 +11,7 @@ import styles from "./facility.module.css" import { ExternalGymDetails, HealthFacilitiesEnum, + OpeningHoursType, } from "@/types/components/hotelPage/facilities" import type { FacilityProps } from "@/types/components/hotelPage/sidepeek/facility" @@ -29,7 +30,9 @@ export default async function Facility({ data }: FacilityProps) { details: data.details, type: data.type, }) - + const showOpeningHours = + data.openingDetails.openingHoursType !== OpeningHoursType.SetFreeText && + !isExternalGym return (
{image ? : null} @@ -46,7 +49,12 @@ export default async function Facility({ data }: FacilityProps) { )} - {isExternalGym ? null : ( + {shortDescription ? ( + +

{shortDescription}

+
+ ) : null} + {showOpeningHours ? (

@@ -92,11 +100,6 @@ export default async function Facility({ data }: FacilityProps) {

- )} - {shortDescription ? ( - -

{shortDescription}

-
) : null} diff --git a/apps/scandic-web/server/routers/hotels/schemas/hotel/healthFacilities.ts b/apps/scandic-web/server/routers/hotels/schemas/hotel/healthFacilities.ts index 7589d4728..058fa36dd 100644 --- a/apps/scandic-web/server/routers/hotels/schemas/hotel/healthFacilities.ts +++ b/apps/scandic-web/server/routers/hotels/schemas/hotel/healthFacilities.ts @@ -53,6 +53,7 @@ export const healthFacilitySchema = z.object({ .boolean() .nullish() .transform((b) => !!b), + openingHoursType: nullableStringValidator, }), type: nullableStringValidator, }) diff --git a/apps/scandic-web/types/components/hotelPage/facilities.ts b/apps/scandic-web/types/components/hotelPage/facilities.ts index da88ac0c4..3dbcf4d30 100644 --- a/apps/scandic-web/types/components/hotelPage/facilities.ts +++ b/apps/scandic-web/types/components/hotelPage/facilities.ts @@ -108,3 +108,8 @@ export enum OutdoorPoolDetails { export enum SaunaDetails { SeparateMenAndWomen = "SeparateMenAndWomen", } + +export const OpeningHoursType = { + SetWeekDayAndWeekEndSchema: "SetWeekDayAndWeekEndSchema", + SetFreeText: "SetFreeText", +} as const