active links in nav, delete report, loaders in report, changes routes
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import React, { useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { NavLink } from "react-router-dom";
|
||||
|
||||
import { getProfileInfo } from "@redux/outstaffingSlice";
|
||||
@ -9,9 +9,9 @@ import { urlForLocal } from "@utils/helper";
|
||||
import avatarMok from "assets/images/avatarMok.png";
|
||||
|
||||
export const Navigation = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const profileInfo = useSelector(getProfileInfo);
|
||||
const currentPath = window.location.pathname;
|
||||
const [user] = useState(
|
||||
localStorage.getItem("role_status") === "18" ? "partner" : "developer"
|
||||
);
|
||||
@ -35,7 +35,7 @@ export const Navigation = () => {
|
||||
name: "Выплаты"
|
||||
},
|
||||
{
|
||||
path: "/Quiz",
|
||||
path: "/quiz",
|
||||
name: "Тесты"
|
||||
},
|
||||
{
|
||||
@ -81,6 +81,7 @@ export const Navigation = () => {
|
||||
key={index}
|
||||
end
|
||||
to={link.path === "/Quiz" ? link.path : `/profile${link.path}`}
|
||||
className={currentPath. includes(link.path) ? 'active' : ''}
|
||||
>
|
||||
{link.name}
|
||||
</NavLink>
|
||||
|
Reference in New Issue
Block a user