From 75117b9248716b52e4f5a1d31c2a3e5ec6358be6 Mon Sep 17 00:00:00 2001 From: Taken Date: Sat, 28 Jun 2025 15:35:02 +0200 Subject: [PATCH] Added mobile support --- .../dashboard/_components/sidebar-client.tsx | 23 +++++++++++++++++++ src/app/(admin)/dashboard/layout.tsx | 15 +++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 src/app/(admin)/dashboard/_components/sidebar-client.tsx diff --git a/src/app/(admin)/dashboard/_components/sidebar-client.tsx b/src/app/(admin)/dashboard/_components/sidebar-client.tsx new file mode 100644 index 0000000..e4b916f --- /dev/null +++ b/src/app/(admin)/dashboard/_components/sidebar-client.tsx @@ -0,0 +1,23 @@ +"use client" + +import { SidebarTrigger } from "@/components/ui/sidebar" +import { useIsMobile } from "@/hooks/use-mobile" +import { ReactNode } from "react" + +export function SidebarClient({ children }: { children: ReactNode }) { + const isMobile = useIsMobile() + + if (isMobile) { + return ( +
+
+ + Linker +
+
{children}
+
+ ) + } + + return children +} diff --git a/src/app/(admin)/dashboard/layout.tsx b/src/app/(admin)/dashboard/layout.tsx index 6035433..875300b 100644 --- a/src/app/(admin)/dashboard/layout.tsx +++ b/src/app/(admin)/dashboard/layout.tsx @@ -1,6 +1,7 @@ import { SidebarProvider } from "@/components/ui/sidebar" import { ReactNode } from "react" import { DashboardSidebar } from "./_components/sidebar" +import { SidebarClient } from "./_components/sidebar-client" export default function DashboardLayout({ children @@ -9,12 +10,14 @@ export default function DashboardLayout({ }) { return ( -
- -
- {children} -
-
+ +
+ +
+ {children} +
+
+
) }