Feat/BOOK-63 hotel subpages branding

* feat(BOOK-63): Replaced css variables and components to apply hotel branding on subpages
* feat(BOOK-63): Replaced css variables and components to apply hotel branding on hotel page map view

Approved-by: Christel Westerberg
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-11-05 08:30:55 +00:00
parent 7fc49428c7
commit 3a38e99a71
47 changed files with 524 additions and 393 deletions

View File

@@ -64,7 +64,8 @@
"./utils/promiseWithTimeout": "./utils/promiseWithTimeout.ts",
"./utils/rangeArray": "./utils/rangeArray.ts",
"./utils/safeTry": "./utils/safeTry.ts",
"./utils/theme": "./utils/theme.ts",
"./utils/theme": "./utils/theme/index.ts",
"./utils/theme/serverContext": "./utils/theme/serverContext.ts",
"./utils/toCapitalCase": "./utils/toCapitalCase.ts",
"./utils/url": "./utils/url.ts",
"./utils/zod/*": "./utils/zod/*.ts"

View File

@@ -0,0 +1,31 @@
import "server-only"
import { cache } from "react"
import { DEFAULT_THEME, type Theme } from "."
const getRef = cache(() => ({ current: DEFAULT_THEME as Theme }))
/**
* Set the global theme
*
* It works kind of like React's context,
* but on the server side, per request.
*
* @param newTheme
*/
export function setTheme(newTheme: Theme) {
getRef().current = newTheme
return newTheme
}
/**
* Get the global theme
*
* Note: This must be called after setTheme() has been called in the page/layout.
* If called before setTheme(), it will return DEFAULT_THEME.
*/
export function getTheme(): Theme {
return getRef().current ?? DEFAULT_THEME
}