active links in nav, delete report, loaders in report, changes routes

This commit is contained in:
Mikola
2024-02-07 18:54:21 +03:00
parent 455be87e26
commit b75b846335
13 changed files with 91 additions and 108 deletions

View File

@ -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>