From b52c25255362752443d56148cea0da135eb5080f Mon Sep 17 00:00:00 2001 From: Bram Suurd <78373894+BramSuurdje@users.noreply.github.com> Date: Mon, 29 Sep 2025 21:56:07 +0200 Subject: [PATCH] fix sidebar loading issues and navbar on mobile (#7991) * Refactor MobileSidebar to manage script and category selection based on current pathname. Introduced temporary state for non-scripts pages and updated logic for last viewed script handling. Improved accessibility by ensuring proper aria attributes and class management. * Update API endpoint paths in data.ts to include ProxmoxVE prefix for category and version fetching functions. * Refactor Navbar component layout for improved structure and responsiveness. Adjusted flex properties to ensure proper alignment of elements, enhancing the mobile and desktop user experience. Updated accessibility features and ensured consistent use of TailwindCSS classes. --- frontend/src/components/navbar.tsx | 44 ++++++++++--------- .../components/navigation/mobile-sidebar.tsx | 37 +++++++++++----- frontend/src/lib/data.ts | 4 +- 3 files changed, 52 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/navbar.tsx b/frontend/src/components/navbar.tsx index b709b6564..a80880006 100644 --- a/frontend/src/components/navbar.tsx +++ b/frontend/src/components/navbar.tsx @@ -42,32 +42,34 @@ function Navbar() { logo Proxmox VE Helper-Scripts -
+
- - - {navbarLinks.map(({ href, event, icon, text, mobileHidden }) => ( - - - - - - - {text} - - - - ))} - +
+ + + {navbarLinks.map(({ href, event, icon, text, mobileHidden }) => ( + + + + + + + {text} + + + + ))} + +
diff --git a/frontend/src/components/navigation/mobile-sidebar.tsx b/frontend/src/components/navigation/mobile-sidebar.tsx index 653b82ee8..086ecaf69 100644 --- a/frontend/src/components/navigation/mobile-sidebar.tsx +++ b/frontend/src/components/navigation/mobile-sidebar.tsx @@ -1,6 +1,7 @@ "use client"; import { useCallback, useEffect, useState } from "react"; +import { usePathname } from "next/navigation"; import { useQueryState } from "nuqs"; import { Menu } from "lucide-react"; @@ -18,9 +19,20 @@ function MobileSidebar() { const [isLoading, setIsLoading] = useState(false); const [categories, setCategories] = useState([]); const [lastViewedScript, setLastViewedScript] = useState