Skip to content

Commit bde2ccb

Browse files
committed
chore: PR review updates
1 parent 2c262fd commit bde2ccb

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

site/src/components/Sidebar/Sidebar.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,19 @@ export const SettingsSidebarNavItem: FC<SettingsSidebarNavItemProps> = ({
6161
href,
6262
end,
6363
}) => {
64+
// useMatch is necessary to verify if the current path matches the href on the initial render of the route
6465
const matchResult = useMatch(href);
6566

6667
return (
6768
<NavLink
6869
end={end}
6970
to={href}
70-
className={() =>
71-
cn(
72-
"relative text-sm text-content-secondary no-underline font-medium py-2 px-3 hover:bg-surface-secondary rounded-md transition ease-in-out duration-150",
73-
{
74-
"font-semibold text-content-primary": matchResult !== null,
75-
},
76-
)
77-
}
71+
className={cn(
72+
"relative text-sm text-content-secondary no-underline font-medium py-2 px-3 hover:bg-surface-secondary rounded-md transition ease-in-out duration-150",
73+
{
74+
"font-semibold text-content-primary": matchResult !== null,
75+
},
76+
)}
7877
>
7978
{children}
8079
</NavLink>

0 commit comments

Comments
 (0)