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
This commit is contained in:
@@ -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 (
|
||||
<div className={styles.content}>
|
||||
{image ? <SidePeekImages images={[image]} /> : null}
|
||||
@@ -46,7 +49,12 @@ export default async function Facility({ data }: FacilityProps) {
|
||||
</ul>
|
||||
</Typography>
|
||||
)}
|
||||
{isExternalGym ? null : (
|
||||
{shortDescription ? (
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p>{shortDescription}</p>
|
||||
</Typography>
|
||||
) : null}
|
||||
{showOpeningHours ? (
|
||||
<div className={styles.openingHoursContainer}>
|
||||
<Typography variant="Title/Subtitle/md">
|
||||
<h4>
|
||||
@@ -92,11 +100,6 @@ export default async function Facility({ data }: FacilityProps) {
|
||||
</div>
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
{shortDescription ? (
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p>{shortDescription}</p>
|
||||
</Typography>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -53,6 +53,7 @@ export const healthFacilitySchema = z.object({
|
||||
.boolean()
|
||||
.nullish()
|
||||
.transform((b) => !!b),
|
||||
openingHoursType: nullableStringValidator,
|
||||
}),
|
||||
type: nullableStringValidator,
|
||||
})
|
||||
|
||||
@@ -108,3 +108,8 @@ export enum OutdoorPoolDetails {
|
||||
export enum SaunaDetails {
|
||||
SeparateMenAndWomen = "SeparateMenAndWomen",
|
||||
}
|
||||
|
||||
export const OpeningHoursType = {
|
||||
SetWeekDayAndWeekEndSchema: "SetWeekDayAndWeekEndSchema",
|
||||
SetFreeText: "SetFreeText",
|
||||
} as const
|
||||
|
||||
Reference in New Issue
Block a user