diff --git a/components/navigation/MainNav/index.tsx b/components/navigation/MainNav/index.tsx index 2b54bf90..af0e7e4b 100644 --- a/components/navigation/MainNav/index.tsx +++ b/components/navigation/MainNav/index.tsx @@ -30,6 +30,7 @@ const MainNav: FC = ({ setOpenSideBar, openSideBar }) => { const [openSearch, setOpenSearch] = useState(false); const [query, setQuery] = useState(""); const pathname = usePathname(); + const basePath = `/${pathname.split("/").splice(1, 1)[0]}`; const { t, lang } = useTranslation(); const isEn = lang === "en"; @@ -69,7 +70,7 @@ const MainNav: FC = ({ setOpenSideBar, openSideBar }) => { onClick={() => setOpenSideBar(false)} label={t(`routes|${menu.title}$title`)} className={`focus--white focus--in ${ - pathname.startsWith(`/${t(`routes|${menu.title}$path`)}`) + `/${t(`routes|${menu.title}$path`)}` === basePath ? " active" : "" }`}