diff --git a/src/components/Navigation/Navigation.jsx b/src/components/Navigation/Navigation.jsx index 4270c886..dc48a5dc 100644 --- a/src/components/Navigation/Navigation.jsx +++ b/src/components/Navigation/Navigation.jsx @@ -9,7 +9,6 @@ import { urlForLocal } from "@utils/helper"; import avatarMok from "assets/images/avatarMok.png"; export const Navigation = () => { - const profileInfo = useSelector(getProfileInfo); const currentPath = window.location.pathname; const [user] = useState( @@ -81,7 +80,7 @@ export const Navigation = () => { key={index} end to={link.path === "/Quiz" ? link.path : `/profile${link.path}`} - className={currentPath. includes(link.path) ? 'active' : ''} + className={currentPath.includes(link.path) ? "active" : ""} > {link.name} diff --git a/src/components/ProfileCalendar/ProfileCalendarComponent.jsx b/src/components/ProfileCalendar/ProfileCalendarComponent.jsx index 84d4f66f..8cab6dd5 100644 --- a/src/components/ProfileCalendar/ProfileCalendarComponent.jsx +++ b/src/components/ProfileCalendar/ProfileCalendarComponent.jsx @@ -98,7 +98,9 @@ export const ProfileCalendarComponent = React.memo( if (userId) { return `/profile/calendar/view/${date.created_at}/${userId}`; } - return `/profile/calendar/view/${date.created_at}/${localStorage.getItem("id")}`; + return `/profile/calendar/view/${ + date.created_at + }/${localStorage.getItem("id")}`; } } @@ -282,15 +284,15 @@ export const ProfileCalendarComponent = React.memo( ? `${getCorrectDate(startDate)} - ${getCorrectDate(endDate)}` : `${getCorrectDate(endDate)} - ${getCorrectDate(startDate)}` : activePeriod - ? "Выберите диапазон на календаре" - : "Выбрать диапазон"} + ? "Выберите диапазон на календаре" + : "Выбрать диапазон"} {totalRangeHours ? `${totalRangeHours} ${hourOfNum(totalRangeHours)}` : endDate - ? "0 часов" - : ""} + ? "0 часов" + : ""} {endDate && ( { }; const handler = () => { - setIsFetching(true) + setIsFetching(true); for (let input of inputs) { if (!input.task || !input.hours_spent) { setReportSuccess("Заполните задачи"); setTimeout(() => setReportSuccess(""), 2000); - setIsFetching(false) + setIsFetching(false); return; } } @@ -294,15 +294,16 @@ const ReportForm = () => {
- {isFetching ? - : + {isFetching ? ( + + ) : ( - } + )}

Всего за день:{" "} diff --git a/src/components/ShortReport/ShortReport.jsx b/src/components/ShortReport/ShortReport.jsx index 355bdd1e..c4b7238e 100644 --- a/src/components/ShortReport/ShortReport.jsx +++ b/src/components/ShortReport/ShortReport.jsx @@ -80,7 +80,9 @@ export const ShortReport = () => {

Ваши отчеты - просмотр отчета за день

- Посмотреть подробный отчет + + Посмотреть подробный отчет +
diff --git a/src/components/features/quiz/CardAviableTest.jsx b/src/components/features/quiz/CardAviableTest.jsx index fc96db86..a1c6d289 100644 --- a/src/components/features/quiz/CardAviableTest.jsx +++ b/src/components/features/quiz/CardAviableTest.jsx @@ -9,7 +9,11 @@ export const CardAvailableTest = ({ title, description, path, status }) => { return (
{ const [taskText, setTaskText] = useState([]); const [difficulties, setDifficulties] = useState([]); const [tomorrowTask, setTomorrowTask] = useState([]); - const [taskId, setTaskId] = useState('') + const [taskId, setTaskId] = useState(""); const [totalHours, setTotalHours] = useState(0); const [currentDay] = useState(new Date()); const [loader, setLoader] = useState(false); - const [deleteLoader, setDeleteLoader] = useState(false) + const [deleteLoader, setDeleteLoader] = useState(false); function getReportFromDate(day) { setLoader(true); @@ -41,7 +41,7 @@ export const ViewReport = () => { apiRequest(`reports/find-by-date?user_id=${params.id}&date=${day}`).then( (res) => { let spendTime = 0; - setTaskId(res[0]?.id) + setTaskId(res[0]?.id); for (const item of res) { if (item.difficulties) { setDifficulties((prevArray) => [...prevArray, item.difficulties]); @@ -69,13 +69,13 @@ export const ViewReport = () => { } function deleteReport() { - setDeleteLoader(true) + setDeleteLoader(true); apiRequest(`reports/delete?id=${taskId}`, { method: "DELETE" }).then((res) => { - setDeleteLoader(false) + setDeleteLoader(false); if (res) { - window.location.replace("/profile/calendar") + window.location.replace("/profile/calendar"); } }); } @@ -125,23 +125,32 @@ export const ViewReport = () => { #

Вернуться

- {localStorage.getItem("role_status") !== "18" && + {localStorage.getItem("role_status") !== "18" && (
- - {deleteLoader ? : - + {deleteLoader ? ( + + ) : ( + - } + )}
- } + )}
previousDay()}>
arrow @@ -157,7 +166,11 @@ export const ViewReport = () => { getCreatedDate(currentDay) === params.date ? "disable" : "" }`} > - +
arrow