From 313cfd31fb51833b8107d0fbecb3149194388492 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Tue, 24 Feb 2026 12:18:36 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20iPad=20portrait=20responsive=20layout?= =?UTF-8?q?=20=E2=80=94=20min-[820px]=20breakpoints=20across=20all=20block?= =?UTF-8?q?s=20+=20tablet=20slide-in=20nav?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Header/Nav/index.tsx | 57 ++++++++++--------- src/blocks/FDCardGridBlock/Component.tsx | 10 ++-- src/blocks/FDCtaSideImageBlock/Component.tsx | 6 +- src/blocks/FDLocationsGridBlock/Component.tsx | 2 +- src/blocks/FDPricingCardBlock/Component.tsx | 10 ++-- .../FDServiceCalculatorBlock/Component.tsx | 6 +- .../FDServiceChooserBlock/Component.tsx | 2 +- src/blocks/FDServicesGridBlock/Component.tsx | 4 +- src/blocks/FDTeamBlock/Component.tsx | 4 +- src/blocks/FDTestimonialBlock/Component.tsx | 2 +- src/blocks/FDUspChecklistBlock/Component.tsx | 2 +- src/blocks/FDVpsCalculatorBlock/Component.tsx | 6 +- src/blocks/FDWideCardBlock/Component.tsx | 2 +- 13 files changed, 59 insertions(+), 54 deletions(-) diff --git a/src/Header/Nav/index.tsx b/src/Header/Nav/index.tsx index 4db9a27..74287f0 100644 --- a/src/Header/Nav/index.tsx +++ b/src/Header/Nav/index.tsx @@ -56,7 +56,6 @@ function groupChildren(children: NavChild[]): { heading: string | null; links: N return result } -/* ── Priority #4: Focus trap hook for mobile menu ──────────────────── */ function useFocusTrap(containerRef: React.RefObject, active: boolean) { useEffect(() => { if (!active || !containerRef.current) return @@ -68,10 +67,8 @@ function useFocusTrap(containerRef: React.RefObject, active: const getFocusableElements = () => Array.from(container.querySelectorAll(focusableSelector)) - // Focus the first focusable element when trap activates const elements = getFocusableElements() if (elements.length > 0) { - // Small delay to ensure the menu transition has started setTimeout(() => elements[0]?.focus(), 100) } @@ -102,16 +99,13 @@ function useFocusTrap(containerRef: React.RefObject, active: }, [active, containerRef]) } -/* ── Priority #10: Check if a nav item matches current path ────────── */ function isActiveSection(item: NavItem, pathname: string | null): boolean { if (!pathname || !item.children?.length) { - // For top-level links without children, check direct href match const href = resolveHref(item) if (href === '/') return pathname === '/' return pathname?.startsWith(href) || false } - // For dropdown parents, check if any child href matches return item.children.some((child) => { const childHref = resolveHref(child) if (childHref === '/' || childHref === '#') return false @@ -119,7 +113,6 @@ function isActiveSection(item: NavItem, pathname: string | null): boolean { }) } - const MegaMenuPanel: React.FC<{ item: NavItem headerRef: React.RefObject @@ -155,7 +148,7 @@ const MegaMenuPanel: React.FC<{ onClick={onClose} /> - {/* Panel — white in light, navy in dark */} + {/* Panel */}
(null) const mobileMenuRef = useRef(null) - // Priority #4: Focus trap useFocusTrap(mobileMenuRef, mobileOpen) useEffect(() => { @@ -275,13 +267,12 @@ export const HeaderNav: React.FC<{ data: HeaderType; socialLinks?: SocialLinkDat return ( <> - {/* ── Desktop nav ── */} -