From 3adb6ffa2c160b844dca8f48035d0c22f3eec563 Mon Sep 17 00:00:00 2001 From: Tilumca Date: Thu, 15 Oct 2026 00:59:42 +0200 Subject: [PATCH] Admin: przebudowa sidebaru z hamburgerem zwijajacym do raila (jak w apce, stan w localStorage) --- admin/src/components/Layout.tsx | 145 +++++++++++++++++++++++++++----- 1 file changed, 123 insertions(+), 22 deletions(-) diff --git a/admin/src/components/Layout.tsx b/admin/src/components/Layout.tsx index df0fe68..863a692 100644 --- a/admin/src/components/Layout.tsx +++ b/admin/src/components/Layout.tsx @@ -4,6 +4,7 @@ import { Building2, Dumbbell, LogOut, + Menu, ScrollText, ShieldCheck, Target, @@ -54,20 +55,46 @@ const SECTIONS: NavSection[] = [ }, ]; +const SIDEBAR_KEY = 'fitos-admin-sidebar-collapsed'; + +function readCollapsed(): boolean { + try { + return localStorage.getItem(SIDEBAR_KEY) === '1'; + } catch { + return false; + } +} + /* Wiersze nawigacji wg Ember: aktywny = tint akcentu + pionowy pasek przy krawędzi. */ -function NavLinks({ items, onNavigate }: { items: NavItem[]; onNavigate?: () => void }) { +function NavLinks({ + items, + collapsed, + onNavigate, +}: { + items: NavItem[]; + collapsed: boolean; + onNavigate?: () => void; +}) { return ( -