diff --git a/src/components/Main/Subject/Nav/Li/Li.tsx b/src/components/Main/Subject/Nav/Li/Li.tsx index 1fca08d..ce50b03 100644 --- a/src/components/Main/Subject/Nav/Li/Li.tsx +++ b/src/components/Main/Subject/Nav/Li/Li.tsx @@ -4,7 +4,7 @@ import { NavLink, NavLinkProps } from "react-router-dom"; interface LiProps extends NavLinkProps { text: string; - to: NavLinkProps["to"]; + to: string; } const LiForm = (props: LiProps) => { @@ -12,6 +12,7 @@ const LiForm = (props: LiProps) => { return (
  • isActive @@ -25,4 +26,12 @@ const LiForm = (props: LiProps) => { ); }; +function geDataTestId(url: string ) { + return "lateralMenu__item" + (isCurrentUrl()) ? "lateralMenu__itemActive" : ""; + + function isCurrentUrl() { + return window.location.href.includes(url); + } +} + export { LiForm }; diff --git a/src/components/Main/Subject/Nav/Nav.tsx b/src/components/Main/Subject/Nav/Nav.tsx index 0a068c1..680e41b 100644 --- a/src/components/Main/Subject/Nav/Nav.tsx +++ b/src/components/Main/Subject/Nav/Nav.tsx @@ -10,7 +10,10 @@ const Nav = () => { return ( <> -