From 7248d5ad7192deccb26396bf12bf33917b9ed7ba Mon Sep 17 00:00:00 2001 From: ghdtjgus76 Date: Mon, 2 Sep 2024 18:02:15 +0900 Subject: [PATCH] =?UTF-8?q?design:=20nav-item=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=9D=B4=EC=8A=88=20=EB=95=8C=EB=AC=B8=EC=97=90=20=EC=83=89=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=20=EC=95=88=20=EB=90=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/src/components/NavItem/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/NavItem/index.tsx b/packages/ui/src/components/NavItem/index.tsx index a417b4b7..29e345f5 100644 --- a/packages/ui/src/components/NavItem/index.tsx +++ b/packages/ui/src/components/NavItem/index.tsx @@ -46,6 +46,11 @@ const NavItem = ({ href, imageUrl, alt, name, items }: NavItemProps) => { } }; + const navItemType = + (!segment[1] && `${segment[0]}` === href) || `/${segment[0]}` === href + ? "active" + : "inactive"; + return ( { href={`${href}`} tabIndex={0} className={navItemStyle({ - type: !segment[1] && `${segment[0]}` === href ? "active" : "inactive", + type: navItemType, })} onClick={handleClickNavItem} >