diff options
| author | MohamedBassem <me@mbassem.com> | 2024-02-22 18:28:08 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-02-22 18:28:08 +0000 |
| commit | 4e1ea0a5a8d11546dddba58c9ac5efa39729c9f7 (patch) | |
| tree | c271508d78dbf9d73ca85d563a510aea69359fb5 /packages/web/app/dashboard/components/ModileSidebarItem.tsx | |
| parent | cd2e65ed10a33283666d9197e597f0b8f6335c15 (diff) | |
| download | karakeep-4e1ea0a5a8d11546dddba58c9ac5efa39729c9f7.tar.zst | |
feature: Introduce a separate sidebar for the mobile
Diffstat (limited to 'packages/web/app/dashboard/components/ModileSidebarItem.tsx')
| -rw-r--r-- | packages/web/app/dashboard/components/ModileSidebarItem.tsx | 27 |
1 files changed, 27 insertions, 0 deletions
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 ( + <li + className={cn( + "flex w-full rounded-lg hover:bg-gray-50", + path == currentPath ? "bg-gray-50" : "", + )} + > + <Link href={path} className="mx-auto px-3 py-2"> + {logo} + </Link> + </li> + ); +} |
