Hide dashboard sidebar on staff/supervisor/admin sub-pages; fix mobile overflow

- Sidebar now shows only on each role's root landing page
  (/dashboard/staff, /dashboard/supervisor, /dashboard/admin) and hides on
  every sub-page beneath them, not just Reports. Navbar's "Dashboard" link
  always leads back to the role root.
- Fixed two dropdown panels (EventsDropdown, the Email/WhatsApp Attendees
  recipient picker) that could extend past the viewport's right edge on
  narrow screens; both now stretch to their trigger's width like other
  dropdowns in the app already do.
- Wrapped the Admin Cashup event-costs table in the same overflow-auto
  container every sibling table on that page already uses, so it scrolls
  horizontally on narrow screens instead of squeezing its columns.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-04 15:30:56 +02:00
co-authored by Claude Sonnet 5
parent 0de3f4be7d
commit 1b4446c828
6 changed files with 56 additions and 48 deletions
+8 -4
View File
@@ -63,10 +63,14 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
);
}
// The Reports page is a full-width, self-contained workspace (its own header, filters, and
// navigation) — the dashboard sidebar's section links (My Events, Profile, Admin, etc.) would
// just crowd it, so it's hidden there specifically, not app-wide.
const hideSidebar = pathname === "/dashboard/supervisor/reports";
// Sub-pages within staff/supervisor/admin (e.g. /dashboard/supervisor/reports,
// /dashboard/admin/cashup/[id]) are full-width workspaces with their own internal navigation
// and header — the dashboard sidebar's section links (My Events, Profile, Admin, etc.) would
// just crowd them. The sidebar stays visible only on each role's root landing page; every
// deeper sub-page hides it. Navigating back is never a dead end: Navbar's "Dashboard" link is
// always present and /dashboard auto-redirects to the role root.
const SIDEBAR_ROOTS = ["/dashboard/staff", "/dashboard/supervisor", "/dashboard/admin"];
const hideSidebar = !!pathname && SIDEBAR_ROOTS.some(root => pathname !== root && pathname.startsWith(root + "/"));
return (
<div className="min-h-screen flex flex-col">