This commit is contained in:
ditiqi 2025-02-18 09:18:45 +08:00
parent d125486795
commit e0245d46a8
1 changed files with 3 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import {
} from "@ant-design/icons"; } from "@ant-design/icons";
import { useAuth } from "@web/src/providers/auth-provider"; import { useAuth } from "@web/src/providers/auth-provider";
import { env } from "@web/src/env"; import { env } from "@web/src/env";
import { useUserAgent } from "@web/src/hooks/useUserAgent";
export interface NavItem { export interface NavItem {
to: string; to: string;
@ -31,7 +32,7 @@ export function useNavItem() {
taxonomy: { slug: TaxonomySlug.CATEGORY }, taxonomy: { slug: TaxonomySlug.CATEGORY },
}, },
}); });
const { previewMode } = useUserAgent();
const navItems = useMemo(() => { const navItems = useMemo(() => {
// 定义固定的导航项 // 定义固定的导航项
const staticItems = { const staticItems = {
@ -67,7 +68,7 @@ export function useNavItem() {
staticItems.letterList, staticItems.letterList,
staticItems.editor, staticItems.editor,
staticItems.letterProgress, staticItems.letterProgress,
staticItems.inbox, !previewMode && staticItems.inbox,
staticItems.help, staticItems.help,
].filter(Boolean); ].filter(Boolean);
}, [data, user]); }, [data, user]);