Skip to content

Commit

Permalink
fix: selected menu class for algolia (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsdonato authored Mar 25, 2024
1 parent f54de62 commit f7db87b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/sidebar-menu/sidebar-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ type SidebarDetailProps = {

export const SidebarDetails = ({ name, children }: SidebarDetailProps) => {
const pathname = usePathname()
const actualPath = pathname.split('/')[1]

return (
<details>
<summary
className={cn({
'selected-menu':
name.toLowerCase().includes(pathname.split('/')[2]) ||
pathname === '/',
'selected-menu': actualPath === name.toLowerCase(),
})}>
{name}
</summary>
Expand Down

0 comments on commit f7db87b

Please sign in to comment.