Skip to content

Commit

Permalink
Adding missing active trail from DIGG-188-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Munterud committed Jan 19, 2024
1 parent f4d8aa5 commit 0e05123
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/navigation/MainNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const MainNav: FC<MainNavProps> = ({ setOpenSideBar, openSideBar }) => {
const [openSearch, setOpenSearch] = useState<boolean>(false);
const [query, setQuery] = useState("");
const pathname = usePathname();
const basePath = `/${pathname.split("/").splice(1, 1)[0]}`;
const { t, lang } = useTranslation();
const isEn = lang === "en";

Expand Down Expand Up @@ -69,7 +70,7 @@ const MainNav: FC<MainNavProps> = ({ 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"
: ""
}`}
Expand Down

0 comments on commit 0e05123

Please sign in to comment.