fix: nav links in side menu

This commit is contained in:
Mahyar Khanbolooki
2025-07-31 19:54:21 +03:30
parent 7d527ec24f
commit 63a38b56f8
+3 -2
View File
@@ -145,12 +145,13 @@ function SideMenu({ menuState, toggleMenuState, nightModeState, togglenightModeS
{menuItems[0] {menuItems[0]
.filter(item => !item.auth || (item.auth && userIsAuthenticated)) .filter(item => !item.auth || (item.auth && userIsAuthenticated))
.map((item, index) => { .map((item, index) => {
const isActive = pathname === `/${name}/${item.href}`; const href = `/${name}/${item.href}`;
const isActive = pathname === href;
return ( return (
<li key={index} className="mt-[18px]"> <li key={index} className="mt-[18px]">
<SideMenuItem <SideMenuItem
className={clsx(isActive && 'text-foreground!')} className={clsx(isActive && 'text-foreground!')}
href={item.href ?? ''} href={href ?? ''}
title={tMenu(item.title)} title={tMenu(item.title)}
onClick={ onClick={
typeof item.href === 'string' typeof item.href === 'string'