feat(BOOK-450): Added theme to hotel page only, reverting previous theme handing on the body tag

Approved-by: Linus Flood
This commit is contained in:
Erik Tiekstra
2025-10-16 12:54:03 +00:00
parent 338c93dd56
commit 038211bf09
9 changed files with 45 additions and 132 deletions

View File

@@ -1,3 +1,3 @@
.page {
.hotelPage {
background-color: var(--Background-Primary);
}

View File

@@ -1,3 +1,4 @@
import { cx } from "class-variance-authority"
import { notFound } from "next/navigation"
import { getHotel, getHotelPage } from "@/lib/trpc/memoizedRequests"
@@ -5,6 +6,7 @@ import { getHotel, getHotelPage } from "@/lib/trpc/memoizedRequests"
import HotelMapPage from "@/components/ContentType/HotelMapPage"
import HotelPage from "@/components/ContentType/HotelPage"
import HotelSubpage from "@/components/ContentType/HotelSubpage"
import { getThemeByHotel } from "@/utils/theme"
import styles from "./page.module.css"
@@ -33,13 +35,26 @@ export default async function HotelPagePage(
return notFound()
}
const hotelTheme = getThemeByHotel(
hotelPageData.hotel_page_id,
hotelData.hotel.hotelType
)
if (searchParams.subpage) {
return <HotelSubpage hotelData={hotelData} subpage={searchParams.subpage} />
return (
<div className={hotelTheme}>
<HotelSubpage hotelData={hotelData} subpage={searchParams.subpage} />
</div>
)
} else if (searchParams.view === "map") {
return <HotelMapPage hotelData={hotelData} />
return (
<div className={hotelTheme}>
<HotelMapPage hotelData={hotelData} />
</div>
)
} else {
return (
<div className={styles.page}>
<div className={cx(styles.hotelPage, hotelTheme)}>
<HotelPage hotelData={hotelData} hotelPageData={hotelPageData} />
</div>
)