mirror of
https://github.com/usememos/memos.git
synced 2025-11-08 08:21:49 +08:00
chore: move archived route
This commit is contained in:
parent
e8e393a9cb
commit
fc7dc58720
2 changed files with 8 additions and 10 deletions
|
|
@ -1,5 +1,5 @@
|
|||
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 { matchPath, NavLink, useLocation } from "react-router-dom";
|
||||
import useDebounce from "react-use/lib/useDebounce";
|
||||
|
|
@ -44,14 +44,8 @@ const HomeSidebar = observer((props: Props) => {
|
|||
title: t("common.explore"),
|
||||
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(
|
||||
async () => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
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 useCurrentUser from "@/hooks/useCurrentUser";
|
||||
import useNavigateTo from "@/hooks/useNavigateTo";
|
||||
|
|
@ -47,9 +47,13 @@ const UserBanner = (props: Props) => {
|
|||
</MenuButton>
|
||||
<Menu placement="bottom-start" style={{ zIndex: "9999" }}>
|
||||
<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>
|
||||
</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}>
|
||||
<LogOutIcon className="w-4 h-auto opacity-60" />
|
||||
<span className="truncate">{t("common.sign-out")}</span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue