The header used to pick its pills by `page === …` and import five module controls, and Plex's Discover/Browse toggle needed a context bridge to reach the sub-view that lives in PlexBrowse. Now the header is an empty band: PageShell hands its root box out as a slot, a page portals its own pills into it (PageHeader), and the palette's Jump-to pill shows where no page does (PageHeaderDefault, rendered inside the page's Suspense so a loading page shows no stand-in). Plex's toggles take the sub-view as a prop; PlexViewBridge and its context are gone, and with them the header's five layer suppressions. No visible change: every header pill's box measured identical against the previous build on eight pages, in Hungarian and English.
20 lines
855 B
TypeScript
20 lines
855 B
TypeScript
import { PageHeader } from "../../components/ui/PageShell";
|
|
import PlexSearchBox from "./PlexSearchBox";
|
|
import PlexScopeToggle from "./PlexScopeToggle";
|
|
import PlexViewToggle from "./PlexViewToggle";
|
|
import type { PlexViewControls } from "./plexSubUrl";
|
|
|
|
// Plex's pills in the floating header: the search box, then the library scope (movie/show/both, plus
|
|
// the playlists/collections surfaces) and the Discover ⟷ Browse switch — relocated here from the
|
|
// filter sidebar so the primary "what am I browsing" controls are always in reach. Both toggles drive
|
|
// PlexBrowse's sub-view, which PlexBrowse hands down as `view`.
|
|
export default function PlexHeader({ view }: { view: PlexViewControls }) {
|
|
return (
|
|
<PageHeader>
|
|
<PlexSearchBox />
|
|
<PlexScopeToggle view={view} />
|
|
<PlexViewToggle view={view} />
|
|
</PageHeader>
|
|
);
|
|
}
|