diff --git a/admin-spa/src/components/nav/SubmenuBar.tsx b/admin-spa/src/components/nav/SubmenuBar.tsx index 82726c1..3fdd945 100644 --- a/admin-spa/src/components/nav/SubmenuBar.tsx +++ b/admin-spa/src/components/nav/SubmenuBar.tsx @@ -2,17 +2,22 @@ import React from 'react'; import { Link, useLocation } from 'react-router-dom'; import type { SubItem } from '@/nav/tree'; -type Props = { items?: SubItem[] }; +type Props = { items?: SubItem[]; fullscreen?: boolean }; -export default function SubmenuBar({ items = [] }: Props) { +export default function SubmenuBar({ items = [], fullscreen = false }: Props) { // Always call hooks first const { pathname } = useLocation(); // Single source of truth: props.items. No fallbacks, no demos, no path-based defaults if (items.length === 0) return null; + // Calculate top position based on fullscreen state + // Fullscreen: top-16 (below 64px header) + // Normal: top-[88px] (below 40px WP admin bar + 48px menu bar) + const topClass = fullscreen ? 'top-0' : 'top-[calc(7rem+32px)]'; + return ( -