mirror of
https://github.com/hanzoai/gui.git
synced 2026-10-25 02:31:41 +00:00
Three of the seven stops were yellow, which over the dark ground is an olive, and the swatches sat in a Group, whose zeroed radii cut a straight edge through each selection ring. The ramp now sweeps one arc of the wheel and every stop is measured: the dimmest clears 3:1 against each of the seven grounds the page can paint, on both schemes. Picking one writes the accent through @hanzo/appearance, so the choice outlives the visit. Co-authored-by: Hanzo Dev <[email protected]>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { InitialPathContext, NEUTRAL, SeasonProvider } from '@hanzogui/logo'
|
|
import { SchemeProvider, useUserScheme } from '@vxrn/color-scheme'
|
|
import { useEffect } from 'react'
|
|
import { GuiProvider } from '@hanzo/gui'
|
|
import tamaConf from '~/config/hanzogui.config'
|
|
import { PostHogProvider } from '~/features/posthog/PostHogProvider'
|
|
import { SearchProvider } from '~/features/site/search/SearchProvider'
|
|
import { restoreAppearance } from '~/features/site/theme/accent'
|
|
import { ToastProvider } from '~/features/studio/ToastProvider'
|
|
|
|
export const Providers = (props: { children: any }) => {
|
|
// The head script paints the type and density knobs before first paint but
|
|
// leaves the colour alone, so the accent lands here, on the first mount.
|
|
useEffect(restoreAppearance, [])
|
|
|
|
return (
|
|
<InitialPathContext.Provider value={NEUTRAL}>
|
|
<SchemeProvider defaultScheme="dark">
|
|
<PostHogProvider>
|
|
<SeasonProvider>
|
|
<WebsiteGuiProvider>
|
|
<SearchProvider>{props.children}</SearchProvider>
|
|
</WebsiteGuiProvider>
|
|
</SeasonProvider>
|
|
</PostHogProvider>
|
|
</SchemeProvider>
|
|
</InitialPathContext.Provider>
|
|
)
|
|
}
|
|
|
|
function WebsiteGuiProvider(props: { children: any }) {
|
|
const { value } = useUserScheme()
|
|
|
|
return (
|
|
<GuiProvider disableInjectCSS defaultTheme={value} config={tamaConf}>
|
|
<ToastProvider>{props.children}</ToastProvider>
|
|
</GuiProvider>
|
|
)
|
|
}
|