From 3a7929689dd4416fe680f400fc039ef153e17d96 Mon Sep 17 00:00:00 2001 From: Mikola Date: Tue, 13 Feb 2024 15:32:48 +0300 Subject: [PATCH] loaders, outSelectClose, notifications --- .../Tracker/TrackerModal/TrackerModal.jsx | 20 ++++++++++--------- .../PartnerAddRequest/PartnerAddRequest.js | 12 +++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx index 5e23fdca..f8063ff3 100644 --- a/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx +++ b/src/components/Modal/Tracker/TrackerModal/TrackerModal.jsx @@ -30,6 +30,7 @@ import { useNotification } from "@hooks/useNotification"; import { getCorrectDate } from "@components/Calendar/calendarHelper"; import BaseButton from "@components/Common/BaseButton/BaseButton"; +import { Loader } from "@components/Common/Loader/Loader"; import ModalLayout from "@components/Common/ModalLayout/ModalLayout"; import arrowRight from "assets/icons/arrows/arrowRightCreateTask.svg"; @@ -40,7 +41,6 @@ import crossWhite from "assets/icons/crossWhite.svg"; import avatarMok from "assets/images/avatarMok.png"; import "./trackerModal.scss"; -import { Loader } from "@components/Common/Loader/Loader"; registerLocale("ru", ru); @@ -91,7 +91,7 @@ export const TrackerModal = ({ const [deadLineDate, setDeadLineDate] = useState(""); const [datePickerOpen, setDatePickerOpen] = useState(false); const [startDate, setStartDate] = useState(new Date()); - const [loader, setLoader] = useState(false) + const [loader, setLoader] = useState(false); const priority = [ { @@ -140,7 +140,7 @@ export const TrackerModal = ({ return; } - setLoader(true) + setLoader(true); apiRequest("/task/create-task", { method: "POST", @@ -162,7 +162,7 @@ export const TrackerModal = ({ text: "Задача с таким именем уже существует", type: "error" }); - setLoader(false) + setLoader(false); } else { for (let i = 0; i < taskTags.length; i++) { apiRequest("/mark/attach", { @@ -190,11 +190,11 @@ export const TrackerModal = ({ setDescriptionTicket(""); setSelectedExecutorTask("Выберите исполнителя"); setSelectedPriority(null); - setLoader(false) + setLoader(false); }); } else { setActive(false); - setLoader(false) + setLoader(false); setValueTicket(""); setDescriptionTicket(""); dispatch(setProjectBoardFetch(projectBoard.id)); @@ -709,11 +709,13 @@ export const TrackerModal = ({ - {loader ? : + {loader ? ( + + ) : ( - Создать + Создать - } + )} )} diff --git a/src/pages/PartnerAddRequest/PartnerAddRequest.js b/src/pages/PartnerAddRequest/PartnerAddRequest.js index 6b34fc99..bef0d353 100644 --- a/src/pages/PartnerAddRequest/PartnerAddRequest.js +++ b/src/pages/PartnerAddRequest/PartnerAddRequest.js @@ -155,15 +155,15 @@ export const PartnerAddRequest = () => { (div) => div.classList && (div.classList.contains("form__block__section__selects") || - div.classList.contains("form__block__dropDown") - || div.classList.contains("form__block__skills") || + div.classList.contains("form__block__dropDown") || + div.classList.contains("form__block__skills") || div.classList.contains("form__block__section__select")) ) ) { - setOpenSkillsSelect(false) - setOpenSpecializationListOpen(false) - setOpenLevelList(false) - setOpenCountList(false) + setOpenSkillsSelect(false); + setOpenSpecializationListOpen(false); + setOpenLevelList(false); + setOpenCountList(false); } };