guardian routes

This commit is contained in:
Mikola
2024-03-15 18:18:10 +03:00
parent 727d55798a
commit f2ad6b43bd
13 changed files with 267 additions and 165 deletions

View File

@ -70,6 +70,7 @@ export const AuthBox = ({ title }) => {
dispatch(setUserInfo(res));
dispatch(loading(false));
dispatch(setRole("ROLE_PARTNER"));
navigate("/profile");
}
});
}

View File

@ -24,9 +24,9 @@ export const AuthHeader = () => {
<span>Главная</span>
</NavLink>
</li>
<li>
<NavLink to={"/profile"}>Кабинет разработчика</NavLink>
</li>
{/*<li>*/}
{/* <NavLink to={"/profile"}>Кабинет разработчика</NavLink>*/}
{/*</li>*/}
<li>
<NavLink to={"/tracker-intro"}>Трекер</NavLink>
</li>

View File

@ -81,7 +81,7 @@ export const Navigation = () => {
<NavLink
key={index}
end
to={link.path === "/quiz" ? link.path : `/profile${link.path}`}
to={`/profile${link.path}`}
className={
currentPath.includes(link.path) ||
currentPath.includes(link.active)

View File

@ -91,11 +91,10 @@ export const ProfileHeader = () => {
});
}, []);
const handler = () => {
setIsLoggingOut(true);
const handler = (e) => {
e.preventDefault()
localStorage.clear();
dispatch(auth(false));
setIsLoggingOut(false);
navigate("/auth");
dispatch(setProfileInfo({}));
};