Merge ticket/025-popout-tabs-dont-apply-theme
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
|||||||
type TimelineBucket,
|
type TimelineBucket,
|
||||||
} from './lib/api'
|
} from './lib/api'
|
||||||
import { DocsNavProvider } from './lib/docsNav'
|
import { DocsNavProvider } from './lib/docsNav'
|
||||||
|
import { useSettingsPanel } from './lib/useSettingsPanel'
|
||||||
|
|
||||||
const POLL_MS = 2000
|
const POLL_MS = 2000
|
||||||
|
|
||||||
@@ -113,7 +114,12 @@ function parsePopOutQuery(): { section: PopOutSectionId | null; range: TimeRange
|
|||||||
return { section, range }
|
return { section, range }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Popped-out routes render outside NavMenu, which is otherwise the only place that calls `useSettingsPanel()` and applies the
|
||||||
|
// colour scheme / custom theme CSS as a side effect. Calling it here (state unused) keeps standalone tabs themed the same as
|
||||||
|
// the main window, including staying live if settings change while the tab is open.
|
||||||
function StandalonePage({ children }: { children: ReactNode }) {
|
function StandalonePage({ children }: { children: ReactNode }) {
|
||||||
|
useSettingsPanel()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DocsNavProvider>
|
<DocsNavProvider>
|
||||||
<div className="h-screen w-screen overflow-auto">{children}</div>
|
<div className="h-screen w-screen overflow-auto">{children}</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user