sections are paths, not a query string
The admin declares its routes in the manifest, so /fofos-admin/layout/header and /fofos-admin/pages/home are real URLs. One reader takes the two segments after the mount; links carry no query string at all, so nothing leaks between sections. What stays in the query is how you are looking — device, tab, view — rather than at what. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useSearchParams } from 'react-router';
|
||||
import { DEFAULT_SECTION, isSectionKey, sectionFor } from './sections';
|
||||
import { useNav } from './routes';
|
||||
import { sectionFor } from './sections';
|
||||
|
||||
/**
|
||||
* The detail panel's chrome header — the section's own name, not the word "Detail".
|
||||
@@ -26,9 +26,8 @@ import { DEFAULT_SECTION, isSectionKey, sectionFor } from './sections';
|
||||
* area and always reachable.
|
||||
*/
|
||||
export const DetailHeader = () => {
|
||||
const [params] = useSearchParams();
|
||||
const raw = params.get('section');
|
||||
const section = sectionFor(isSectionKey(raw) ? raw : DEFAULT_SECTION);
|
||||
const { section: key } = useNav();
|
||||
const section = sectionFor(key);
|
||||
const Icon = section.icon;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user