diff options
| -rwxr-xr-x | bun.lockb | bin | 270592 -> 270624 bytes | |||
| -rw-r--r-- | web/app/dashboard/bookmarks/components/AddLink.tsx (renamed from web/app/bookmarks/components/AddLink.tsx) | 0 | ||||
| -rw-r--r-- | web/app/dashboard/bookmarks/components/LinkCard.tsx (renamed from web/app/bookmarks/components/LinkCard.tsx) | 0 | ||||
| -rw-r--r-- | web/app/dashboard/bookmarks/components/LinksGrid.tsx (renamed from web/app/bookmarks/components/LinksGrid.tsx) | 2 | ||||
| -rw-r--r-- | web/app/dashboard/bookmarks/page.tsx (renamed from web/app/bookmarks/page.tsx) | 12 | ||||
| -rw-r--r-- | web/app/dashboard/components/Sidebar.tsx | 56 | ||||
| -rw-r--r-- | web/app/dashboard/layout.tsx | 15 |
7 files changed, 80 insertions, 5 deletions
| Binary files differ diff --git a/web/app/bookmarks/components/AddLink.tsx b/web/app/dashboard/bookmarks/components/AddLink.tsx index fab4db8b..fab4db8b 100644 --- a/web/app/bookmarks/components/AddLink.tsx +++ b/web/app/dashboard/bookmarks/components/AddLink.tsx diff --git a/web/app/bookmarks/components/LinkCard.tsx b/web/app/dashboard/bookmarks/components/LinkCard.tsx index da59d9da..da59d9da 100644 --- a/web/app/bookmarks/components/LinkCard.tsx +++ b/web/app/dashboard/bookmarks/components/LinkCard.tsx diff --git a/web/app/bookmarks/components/LinksGrid.tsx b/web/app/dashboard/bookmarks/components/LinksGrid.tsx index 4b82df98..66f0d766 100644 --- a/web/app/bookmarks/components/LinksGrid.tsx +++ b/web/app/dashboard/bookmarks/components/LinksGrid.tsx @@ -12,7 +12,7 @@ export default async function LinksGrid() { const links = await getLinks(session.user.id); return ( - <div className="container p-8 mx-auto grid gap-4 grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"> + <div className="container grid gap-4 grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"> {links.map((l) => ( <LinkCard key={l.id} link={l} /> ))} diff --git a/web/app/bookmarks/page.tsx b/web/app/dashboard/bookmarks/page.tsx index 89a26122..b4158893 100644 --- a/web/app/bookmarks/page.tsx +++ b/web/app/dashboard/bookmarks/page.tsx @@ -8,9 +8,13 @@ export const metadata: Metadata = { export default async function Bookmarks() { return ( - <> - <AddLink /> - <LinksGrid /> - </> + <div className="flex flex-col"> + <div> + <AddLink /> + </div> + <div> + <LinksGrid /> + </div> + </div> ); } diff --git a/web/app/dashboard/components/Sidebar.tsx b/web/app/dashboard/components/Sidebar.tsx new file mode 100644 index 00000000..0ed87daf --- /dev/null +++ b/web/app/dashboard/components/Sidebar.tsx @@ -0,0 +1,56 @@ +import { Button } from "@/components/ui/button"; +import { authOptions } from "@/lib/auth"; +import { Archive, MoreHorizontal, Star, Tag, Home, Brain} from "lucide-react"; +import { getServerSession } from "next-auth"; +import Link from "next/link"; +import { redirect } from "next/navigation"; + +function SidebarItem({ + name, + logo, + path, +}: { + name: string; + logo: React.ReactNode; + path: string; +}) { + return ( + <li className="rounded-lg px-3 py-2 hover:bg-slate-100"> + <Link href={path} className="flex w-full space-x-2"> + {logo} + <span className="my-auto"> {name} </span> + </Link> + </li> + ); +} + +export default async function Sidebar() { + const session = await getServerSession(authOptions); + if (!session) { + redirect("/"); + } + + return ( + <aside className="flex flex-col h-full w-60 border-r p-4"> + <div className="flex px-1 mb-5 items-center rounded-lg text-slate-900"> + <Brain /> + <span className="ml-2 text-base font-semibold">Remember</span> + </div> + <hr /> + <div> + <ul className="space-y-2 mt-5 text-sm font-medium"> + <SidebarItem logo={<Home />} name="Home" path="#" /> + <SidebarItem logo={<Star />} name="Favourites" path="#" /> + <SidebarItem logo={<Archive />} name="Archived" path="#" /> + <SidebarItem logo={<Tag />} name="Tags" path="#" /> + </ul> + </div> + <div className="mt-auto flex justify-between"> + <div className="my-auto"> {session.user.name} </div> + <Button variant="ghost" className="h-10 w-30"> + <MoreHorizontal /> + </Button> + </div> + </aside> + ); +} diff --git a/web/app/dashboard/layout.tsx b/web/app/dashboard/layout.tsx new file mode 100644 index 00000000..9b21271e --- /dev/null +++ b/web/app/dashboard/layout.tsx @@ -0,0 +1,15 @@ +import Bookmarks from "@/app/dashboard/bookmarks/page"; +import Sidebar from "@/app/dashboard/components/Sidebar"; + +export default async function Dashboard() { + return ( + <div className="flex w-screen h-screen"> + <div className="flex-none"> + <Sidebar /> + </div> + <div className="flex-1 bg-gray-100"> + <Bookmarks /> + </div> + </div> + ); +} |
