Skip to content

Commit

Permalink
[Design] nav-item 경로 이슈 때문에 색 적용 안 되는 문제 해결 (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghdtjgus76 authored Sep 2, 2024
1 parent 4fa3775 commit 2900a53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ui/src/components/NavItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<styled.div listStyle="none" role="presentation">
<Link
Expand All @@ -55,7 +60,7 @@ const NavItem = ({ href, imageUrl, alt, name, items }: NavItemProps) => {
href={`${href}`}
tabIndex={0}
className={navItemStyle({
type: !segment[1] && `${segment[0]}` === href ? "active" : "inactive",
type: navItemType,
})}
onClick={handleClickNavItem}
>
Expand Down

0 comments on commit 2900a53

Please sign in to comment.