initial commit
Some checks failed
ci / go (push) Has been cancelled
ci / admin-ui (push) Has been cancelled
ci / runtime-sdk (push) Has been cancelled
ci / helm (push) Has been cancelled
ci / openapi (push) Has been cancelled
ci / container (push) Has been cancelled
ci / release-config (push) Has been cancelled
ci / shared styling (push) Has been cancelled
ci / security (push) Has been cancelled
ci / all green (push) Has been cancelled
Some checks failed
ci / go (push) Has been cancelled
ci / admin-ui (push) Has been cancelled
ci / runtime-sdk (push) Has been cancelled
ci / helm (push) Has been cancelled
ci / openapi (push) Has been cancelled
ci / container (push) Has been cancelled
ci / release-config (push) Has been cancelled
ci / shared styling (push) Has been cancelled
ci / security (push) Has been cancelled
ci / all green (push) Has been cancelled
This commit is contained in:
commit
951dd8d26b
175 changed files with 50041 additions and 0 deletions
19
web/src/components/use-admin-theme.ts
Normal file
19
web/src/components/use-admin-theme.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { useContext } from 'react'
|
||||
|
||||
import { AdminThemeContextInstance, type AdminThemeValue } from './admin-theme-context'
|
||||
|
||||
/**
|
||||
* Reads the admin theme context.
|
||||
*
|
||||
* Throws when used outside a provider rather than returning a default. A silent
|
||||
* default would let a component render with the wrong theme and never report the
|
||||
* mistake, which is exactly the class of bug this codebase's tooling exists to
|
||||
* surface.
|
||||
*/
|
||||
export function useAdminTheme(): AdminThemeValue {
|
||||
const value = useContext(AdminThemeContextInstance)
|
||||
if (!value) {
|
||||
throw new Error('useAdminTheme must be used inside an AdminThemeProvider')
|
||||
}
|
||||
return value
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue