mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 06:27:16 +08:00
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 -->
50 lines
1.7 KiB
TypeScript
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 }
|