From 43d53a9ffa834b2a910c78efc40637dd984ae2f4 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Mon, 11 Mar 2024 13:17:45 +0800 Subject: [PATCH] fix: default value --- src/components/layout/layout-item.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/layout/layout-item.tsx b/src/components/layout/layout-item.tsx index 82ec8b19..8d5e841c 100644 --- a/src/components/layout/layout-item.tsx +++ b/src/components/layout/layout-item.tsx @@ -15,7 +15,7 @@ interface Props { export const LayoutItem = (props: Props) => { const { to, children, icon } = props; const { verge } = useVerge(); - const { menu_icon = "monochrome" } = verge ?? {}; + const { menu_icon } = verge ?? {}; const resolved = useResolvedPath(to); const match = useMatch({ path: resolved.pathname, end: true }); const navigate = useNavigate(); @@ -52,9 +52,12 @@ export const LayoutItem = (props: Props) => { ]} onClick={() => navigate(to)} > - {menu_icon === "monochrome" && ( - {icon[0]} - )} + {menu_icon === "monochrome" || + (!menu_icon && ( + + {icon[0]} + + ))} {menu_icon === "colorful" && {icon[1]}}