Skip to content

Commit

Permalink
Add simple active state to navbar items (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianstasik authored Sep 19, 2023
1 parent a302295 commit ddf33f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/theme/NavbarItem/DefaultNavbarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ function DefaultNavbarItemMobile({

export default function DefaultNavbarItem({
mobile = false,
position,
activeClassName,
...props
}: Props) {
const Comp = mobile ? DefaultNavbarItemMobile : DefaultNavbarItemDesktop;
return <Comp {...props} activeClassName={props.activeClassName} />;
return (
<Comp {...props} activeClassName={clsx(activeClassName, "underline")} />
);
}
5 changes: 4 additions & 1 deletion src/theme/NavbarItem/DropdownNavbarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ function DropdownNavbarItemMobile({

export default function DropdownNavbarItem({
mobile = false,
activeClassName,
...props
}: Props) {
const Comp = mobile ? DropdownNavbarItemMobile : DropdownNavbarItemDesktop;
return <Comp {...props} />;
return (
<Comp {...props} activeClassName={clsx(activeClassName, "underline")} />
);
}

0 comments on commit ddf33f5

Please sign in to comment.