Skip to content

Commit

Permalink
added bookmarks page
Browse files Browse the repository at this point in the history
  • Loading branch information
NazireAta committed May 15, 2024
1 parent faabafd commit aa3554c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/src/components/NavbarLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ import { Sheet, SheetContent, SheetTrigger } from "./ui/sheet";
import { SearchBar } from "./SearchBar";
import useAuthStore from "../services/auth";
import { FullscreenLoading } from "./FullscreenLoading";
import { useNavigate } from "react-router-dom";

const links = [{ name: "Home", path: "/" }] as const;

export const NavbarLayout = () => {
const fetcher = useFetcher();
const isAuthenticated = !!useAuthStore().token;

const navigate = useNavigate();
const navigation = useNavigation();

return (
Expand Down Expand Up @@ -107,6 +108,12 @@ export const NavbarLayout = () => {
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem>
<div className="cursor-pointer text-sm font-medium hover:underline" onClick={() => navigate("/bookmarks")}> Bookmarks </div>
<form id="bookmarksForm" method="POST" action="/bookmarks" style={{ display: 'none' }}>
{/* Hidden form for submission */}
</form>
</DropdownMenuItem>
<DropdownMenuItem>
<fetcher.Form method="POST" action="/logout">
<Button type="submit">Log out</Button>
Expand Down

0 comments on commit aa3554c

Please sign in to comment.