Improve mobile responsiveness with hamburger menu and drawer sidebar

This commit is contained in:
AyrisAI
2026-05-14 22:56:39 +03:00
parent 47dced6f89
commit 99f9b51db8
4 changed files with 143 additions and 19 deletions

View File

@@ -5,7 +5,7 @@ import Link from "next/link";
import { usePathname } from "next/navigation";
import LanguageSwitcher from "./LanguageSwitcher";
export default function Sidebar({ dict, lang }: { dict: any; lang: string }) {
export default function Sidebar({ dict, lang, onClose }: { dict: any; lang: string; onClose?: () => void }) {
const { data: session } = useSession();
const pathname = usePathname();
const role = session?.user?.role ?? "";
@@ -61,6 +61,7 @@ export default function Sidebar({ dict, lang }: { dict: any; lang: string }) {
key={item.href}
href={item.href}
className={`nav-item ${pathname === item.href ? "active" : ""}`}
onClick={onClose}
>
<item.icon />
{item.label}