Commit fc7dc587 authored by Johnny's avatar Johnny

chore: move archived route

parent e8e393a9
import { last } from "lodash-es"; import { last } from "lodash-es";
import { ArchiveIcon, Globe2Icon, HomeIcon } from "lucide-react"; import { Globe2Icon, HomeIcon } from "lucide-react";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { matchPath, NavLink, useLocation } from "react-router-dom"; import { matchPath, NavLink, useLocation } from "react-router-dom";
import useDebounce from "react-use/lib/useDebounce"; import useDebounce from "react-use/lib/useDebounce";
...@@ -44,14 +44,8 @@ const HomeSidebar = observer((props: Props) => { ...@@ -44,14 +44,8 @@ const HomeSidebar = observer((props: Props) => {
title: t("common.explore"), title: t("common.explore"),
icon: <Globe2Icon className="w-4 h-auto opacity-70 shrink-0" />, icon: <Globe2Icon className="w-4 h-auto opacity-70 shrink-0" />,
}; };
const archivedNavLink: NavLinkItem = {
id: "header-archived",
path: Routes.ARCHIVED,
title: t("common.archived"),
icon: <ArchiveIcon className="w-4 h-auto opacity-70 shrink-0" />,
};
const navLinks: NavLinkItem[] = currentUser ? [homeNavLink, exploreNavLink, archivedNavLink] : [exploreNavLink]; const navLinks: NavLinkItem[] = currentUser ? [homeNavLink, exploreNavLink] : [exploreNavLink];
useDebounce( useDebounce(
async () => { async () => {
......
import { Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy"; import { Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy";
import { LogOutIcon, User2Icon, SmileIcon } from "lucide-react"; import { ArchiveIcon, LogOutIcon, User2Icon, SquareUserIcon } from "lucide-react";
import { authServiceClient } from "@/grpcweb"; import { authServiceClient } from "@/grpcweb";
import useCurrentUser from "@/hooks/useCurrentUser"; import useCurrentUser from "@/hooks/useCurrentUser";
import useNavigateTo from "@/hooks/useNavigateTo"; import useNavigateTo from "@/hooks/useNavigateTo";
...@@ -47,9 +47,13 @@ const UserBanner = (props: Props) => { ...@@ -47,9 +47,13 @@ const UserBanner = (props: Props) => {
</MenuButton> </MenuButton>
<Menu placement="bottom-start" style={{ zIndex: "9999" }}> <Menu placement="bottom-start" style={{ zIndex: "9999" }}>
<MenuItem onClick={() => navigateTo(`/u/${encodeURIComponent(currentUser.username)}`)}> <MenuItem onClick={() => navigateTo(`/u/${encodeURIComponent(currentUser.username)}`)}>
<SmileIcon className="w-4 h-auto opacity-60" /> <SquareUserIcon className="w-4 h-auto opacity-60" />
<span className="truncate">{t("common.profile")}</span> <span className="truncate">{t("common.profile")}</span>
</MenuItem> </MenuItem>
<MenuItem onClick={() => navigateTo(Routes.ARCHIVED)}>
<ArchiveIcon className="w-4 h-auto opacity-60" />
<span className="truncate">{t("common.archived")}</span>
</MenuItem>
<MenuItem onClick={handleSignOut}> <MenuItem onClick={handleSignOut}>
<LogOutIcon className="w-4 h-auto opacity-60" /> <LogOutIcon className="w-4 h-auto opacity-60" />
<span className="truncate">{t("common.sign-out")}</span> <span className="truncate">{t("common.sign-out")}</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment