diff --git a/src/components/dashboard-header.tsx b/src/components/dashboard-header.tsx
index 339323d..c1fd23f 100644
--- a/src/components/dashboard-header.tsx
+++ b/src/components/dashboard-header.tsx
@@ -1,6 +1,7 @@
import { Button } from "./ui/button";
import { useRouter } from "@tanstack/react-router";
import { BiHome } from "react-icons/bi";
+import { DashboardMobileNav } from "./dashboard-mobile-nav";
export default function DashboardHeader() {
const router = useRouter();
@@ -18,6 +19,9 @@ export default function DashboardHeader() {
Home
+
+
+
);
diff --git a/src/components/dashboard-mobile-nav.tsx b/src/components/dashboard-mobile-nav.tsx
new file mode 100644
index 0000000..b09274a
--- /dev/null
+++ b/src/components/dashboard-mobile-nav.tsx
@@ -0,0 +1,92 @@
+import { useState } from "react";
+import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
+import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";
+import { Home, Menu } from "lucide-react";
+import { Link, useRouter } from "@tanstack/react-router";
+
+export function DashboardMobileNav() {
+ const [open, setOpen] = useState(false);
+
+ const data = [
+ {
+ title: "Products",
+ to: "/dashboard/products",
+ },
+ {
+ title: "Users",
+ to: "/dashboard/users",
+ },
+ {
+ title: "Orders",
+ to: "/dashboard/orders",
+ },
+ {
+ title: "Upload",
+ to: "/dashboard/upload",
+ },
+ ];
+
+ return (
+
+
+
+
+
+
+
+ Home
+
+
+
+ {data.map((nav, index) => (
+
+ {nav.title}
+
+ ))}
+
+
+
+
+ );
+}
+
+interface MobileLinkProps {
+ to: any;
+ onOpenChange?: (open: boolean) => void;
+ children: React.ReactNode;
+ className?: string;
+}
+
+function MobileLink({
+ to,
+ onOpenChange,
+ className,
+ children,
+ ...props
+}: MobileLinkProps) {
+ const router = useRouter();
+ return (
+ {
+ router.navigate({ to: to.toString() });
+ onOpenChange?.(false);
+ }}
+ className={cn(className)}
+ {...props}
+ >
+ {children}
+
+ );
+}
diff --git a/src/routes/_admin.tsx b/src/routes/_admin.tsx
index 87966b6..936d4e9 100644
--- a/src/routes/_admin.tsx
+++ b/src/routes/_admin.tsx
@@ -9,7 +9,7 @@ export const Route = createFileRoute("/_admin")({
}
},
component: () => (
-
+
@@ -20,7 +20,7 @@ export const Route = createFileRoute("/_admin")({
export function Sidebar() {
return (
-