From 4e1ea0a5a8d11546dddba58c9ac5efa39729c9f7 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Thu, 22 Feb 2024 18:28:08 +0000 Subject: feature: Introduce a separate sidebar for the mobile --- .../web/app/dashboard/components/ModileSidebar.tsx | 24 +++++++++++++++++++ .../app/dashboard/components/ModileSidebarItem.tsx | 27 ++++++++++++++++++++++ packages/web/app/dashboard/components/Sidebar.tsx | 2 +- .../web/app/dashboard/components/SidebarItem.tsx | 2 +- packages/web/app/dashboard/layout.tsx | 14 ++++++++--- 5 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 packages/web/app/dashboard/components/ModileSidebar.tsx create mode 100644 packages/web/app/dashboard/components/ModileSidebarItem.tsx (limited to 'packages/web/app/dashboard') diff --git a/packages/web/app/dashboard/components/ModileSidebar.tsx b/packages/web/app/dashboard/components/ModileSidebar.tsx new file mode 100644 index 00000000..74cbacba --- /dev/null +++ b/packages/web/app/dashboard/components/ModileSidebar.tsx @@ -0,0 +1,24 @@ +import MobileSidebarItem from "./ModileSidebarItem"; +import { Archive, Star, Tag, PackageOpen, Settings } from "lucide-react"; +import SidebarProfileOptions from "./SidebarProfileOptions"; + +export default async function MobileSidebar() { + return ( + + ); +} diff --git a/packages/web/app/dashboard/components/ModileSidebarItem.tsx b/packages/web/app/dashboard/components/ModileSidebarItem.tsx new file mode 100644 index 00000000..9389d2e4 --- /dev/null +++ b/packages/web/app/dashboard/components/ModileSidebarItem.tsx @@ -0,0 +1,27 @@ +"use client"; + +import { cn } from "@/lib/utils"; +import Link from "next/link"; +import { usePathname } from "next/navigation"; + +export default function MobileSidebarItem({ + logo, + path, +}: { + logo: React.ReactNode; + path: string; +}) { + const currentPath = usePathname(); + return ( +
  • + + {logo} + +
  • + ); +} diff --git a/packages/web/app/dashboard/components/Sidebar.tsx b/packages/web/app/dashboard/components/Sidebar.tsx index 6cf90121..b8b7fc56 100644 --- a/packages/web/app/dashboard/components/Sidebar.tsx +++ b/packages/web/app/dashboard/components/Sidebar.tsx @@ -45,7 +45,7 @@ export default async function Sidebar() { /> -
    +
    {session.user.name}
    diff --git a/packages/web/app/dashboard/components/SidebarItem.tsx b/packages/web/app/dashboard/components/SidebarItem.tsx index e6a00d72..74d20bc0 100644 --- a/packages/web/app/dashboard/components/SidebarItem.tsx +++ b/packages/web/app/dashboard/components/SidebarItem.tsx @@ -18,7 +18,7 @@ export default function SidebarItem({
  • diff --git a/packages/web/app/dashboard/layout.tsx b/packages/web/app/dashboard/layout.tsx index 9d3568a5..393ad8bb 100644 --- a/packages/web/app/dashboard/layout.tsx +++ b/packages/web/app/dashboard/layout.tsx @@ -1,3 +1,5 @@ +import { Separator } from "@/components/ui/separator"; +import MobileSidebar from "./components/ModileSidebar"; import Sidebar from "./components/Sidebar"; export default async function Dashboard({ @@ -6,11 +8,17 @@ export default async function Dashboard({ children: React.ReactNode; }>) { return ( -
    -
    +
    +
    -
    {children}
    +
    +
    + + +
    + {children} +
    ); } -- cgit v1.2.3-70-g09d2