Skip to content

Commit

Permalink
chore: update SidebarNavigation on docs site to fix double highlight bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrantz committed Sep 28, 2023
1 parent 32285ed commit 0aee70f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ const SiteSidebarNavigation = (): JSX.Element => {
>
<SidebarAnchor href={SidebarCategoryRoutes.COMPONENTS}>Overview</SidebarAnchor>
{filteredComponentSidebarItems.map(({name, slug}: {[key: string]: string}) => {
const selected = pathname.includes(`${SidebarCategoryRoutes.COMPONENTS}/${slug}`);
const categoryRoute = `${SidebarCategoryRoutes.COMPONENTS}/${slug}`;
const selected = pathname.endsWith(categoryRoute) || pathname.includes(`${categoryRoute}/`);
if (name === 'Icon') {
return (
<NavigationDisclosure
Expand Down

0 comments on commit 0aee70f

Please sign in to comment.