Files
supabase/apps/docs/features/app.providers.tsx
Ivan Vasilov 97a8df0a23 feat: Handle the classic-dark theme in www and docs apps (#45214)
This PR fixes a bug where a user might choose `classic-dark` as a theme
in `studio` but then `docs` and `marketing` apps will look weird.

To test:
- Change the localStorage value of `theme` to `classic-dark`
- Open `www` and `docs` apps, they should look ok

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a new "classic-dark" theme option for enhanced visual
customization.

* **Improvements**
* Unified and simplified theme handling across apps for more consistent
behavior.
* Improved system-theme detection and smoother transitions when
switching themes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-05 16:18:46 +02:00

50 lines
1.7 KiB
TypeScript

import SiteLayout from '~/layouts/SiteLayout'
import { API_URL } from '~/lib/constants'
import { FeatureFlagProvider, IS_PLATFORM, ThemeProvider } from 'common'
import { DevToolbar, DevToolbarProvider } from 'dev-tools'
import type { PropsWithChildren } from 'react'
import { TooltipProvider } from 'ui'
import { AuthContainer } from './auth/auth.client'
import { DocsCommandMenu, DocsCommandProvider } from './command'
import { QueryClientProvider } from './data/queryClient.client'
import { PageTelemetry } from './telemetry/telemetry.client'
import { Toaster } from './toaster'
import { ScrollRestoration } from './ui/helpers.scroll.client'
import { ThemeSandbox } from './ui/theme.client'
/**
* Global providers that wrap the entire app
*/
function GlobalProviders({ children }: PropsWithChildren) {
return (
<QueryClientProvider>
<AuthContainer>
<FeatureFlagProvider API_URL={API_URL} enabled={IS_PLATFORM}>
<DevToolbarProvider apiUrl={API_URL}>
<PageTelemetry />
<ScrollRestoration />
<ThemeProvider>
<TooltipProvider delayDuration={0}>
<DocsCommandProvider>
<div className="flex flex-col">
<SiteLayout>
{children}
<DocsCommandMenu />
</SiteLayout>
<ThemeSandbox />
</div>
</DocsCommandProvider>
<Toaster />
<DevToolbar />
</TooltipProvider>
</ThemeProvider>
</DevToolbarProvider>
</FeatureFlagProvider>
</AuthContainer>
</QueryClientProvider>
)
}
export { GlobalProviders }