Skip to content

Commit

Permalink
End of part 7
Browse files Browse the repository at this point in the history
  • Loading branch information
codinginflow committed Jul 9, 2024
1 parent 35d12ea commit 5b3b123
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
58 changes: 58 additions & 0 deletions src/app/(main)/MenuBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Button } from "@/components/ui/button";
import { Bell, Bookmark, Home, Mail } from "lucide-react";
import Link from "next/link";

interface MenuBarProps {
className?: string;
}

export default function MenuBar({ className }: MenuBarProps) {
return (
<div className={className}>
<Button
variant="ghost"
className="flex items-center justify-start gap-3"
title="Home"
asChild
>
<Link href="/">
<Home />
<span className="hidden lg:inline">Home</span>
</Link>
</Button>
<Button
variant="ghost"
className="flex items-center justify-start gap-3"
title="Notifications"
asChild
>
<Link href="/notifications">
<Bell />
<span className="hidden lg:inline">Notifications</span>
</Link>
</Button>
<Button
variant="ghost"
className="flex items-center justify-start gap-3"
title="Messages"
asChild
>
<Link href="/messages">
<Mail />
<span className="hidden lg:inline">Messages</span>
</Link>
</Button>
<Button
variant="ghost"
className="flex items-center justify-start gap-3"
title="Bookmarks"
asChild
>
<Link href="/bookmarks">
<Bookmark />
<span className="hidden lg:inline">Bookmarks</span>
</Link>
</Button>
</div>
);
}
7 changes: 6 additions & 1 deletion src/app/(main)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { validateRequest } from "@/auth";
import { redirect } from "next/navigation";
import MenuBar from "./MenuBar";
import Navbar from "./Navbar";
import SessionProvider from "./SessionProvider";

Expand All @@ -16,7 +17,11 @@ export default async function Layout({
<SessionProvider value={session}>
<div className="flex min-h-screen flex-col">
<Navbar />
<div className="mx-auto max-w-7xl p-5">{children}</div>
<div className="mx-auto flex w-full max-w-7xl grow gap-5 p-5">
<MenuBar className="sticky top-[5.25rem] hidden h-fit flex-none space-y-3 rounded-2xl bg-card px-3 py-5 shadow-sm sm:block lg:px-5 xl:w-80" />
{children}
</div>
<MenuBar className="sticky bottom-0 flex w-full justify-center gap-5 border-t bg-card p-3 sm:hidden" />
</div>
</SessionProvider>
);
Expand Down
6 changes: 5 additions & 1 deletion src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export default function Home() {
return <main>Front page</main>;
return (
<main className="h-[200vh] w-full bg-red-50">
<div className="w-full">Front page</div>
</main>
);
}

0 comments on commit 5b3b123

Please sign in to comment.