feat(site): allow dismissing the active alerts banner and soften its red (#2478)

This commit is contained in:
Sven van Ginkel
2026-09-30 18:17:02 +02:00
committed by GitHub
parent 2ca5e727f9
commit 15c29fee92
4 changed files with 47 additions and 11 deletions

View File

@@ -229,14 +229,14 @@ function getStorageValue(key: string, defaultValue: unknown, storageInterface: S
/** Hook to sync value in local or session storage */
export function useBrowserStorage<T>(key: string, defaultValue: T, storageInterface: Storage = localStorage) {
key = `besz-${key}`
const [value, setValue] = useState(() => {
const [value, setValue] = useState<T>(() => {
return getStorageValue(key, defaultValue, storageInterface)
})
useEffect(() => {
storageInterface?.setItem(key, JSON.stringify(value))
}, [key, value])
return [value, setValue]
return [value, setValue] as const
}
/** Format temperature to user's preferred unit */