From f7049569e19805bad388e5f34c0866eed41c85f8 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Sun, 23 Aug 2026 16:00:31 +0200 Subject: [PATCH] fix(admin): make admin panel layout responsive on mobile The permanent 224px sidebar in the admin layout had no responsive handling at all, leaving almost no width for content on a phone (Gitea #10). Sidebar is now hidden below md: and replaced by a topbar + slide-in Sheet drawer (AdminMobileNav) with the same nav links; content padding and the outer flex direction adapt per breakpoint. --- src/app/p/[secret]/layout.tsx | 18 ++++-- src/components/admin/AdminMobileNav.tsx | 77 +++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 src/components/admin/AdminMobileNav.tsx diff --git a/src/app/p/[secret]/layout.tsx b/src/app/p/[secret]/layout.tsx index 69229ac..e91e3cb 100644 --- a/src/app/p/[secret]/layout.tsx +++ b/src/app/p/[secret]/layout.tsx @@ -3,6 +3,7 @@ import { auth } from "@clerk/nextjs/server"; import Link from "next/link"; import { createTRPCCaller } from "@/trpc/server"; import { timingSafeStringEqual } from "@/lib/timing-safe-compare"; +import { AdminMobileNav } from "@/components/admin/AdminMobileNav"; import { LayoutDashboard, Users, @@ -71,10 +72,19 @@ export default async function AdminLayout({ children, params }: AdminLayoutProps : []), ]; + const navForMobile = nav.map(({ href, label, Icon }) => ({ + href, + label, + icon: , + })); + return ( -
- {/* Sidebar */} -