diff --git a/src/components/Modal/AcceptModal/AcceptModal.jsx b/src/components/Modal/AcceptModal/AcceptModal.jsx index a2b3750b..c115a4fe 100644 --- a/src/components/Modal/AcceptModal/AcceptModal.jsx +++ b/src/components/Modal/AcceptModal/AcceptModal.jsx @@ -4,15 +4,18 @@ import close from "assets/icons/closeProjectPersons.svg"; import "./acceptModal.scss"; -export const AcceptModal = ({ closeModal, agreeHandler }) => { +export const AcceptModal = ({title, closeModal, agreeHandler }) => { return (

- Вы точно хотите переместить задачу в архив? + {title}

-
{acceptModalOpen && ( - + )}
diff --git a/src/pages/ProjectTracker/ProjectTracker.js b/src/pages/ProjectTracker/ProjectTracker.js index 25d95d23..9a19dd5c 100644 --- a/src/pages/ProjectTracker/ProjectTracker.js +++ b/src/pages/ProjectTracker/ProjectTracker.js @@ -39,6 +39,7 @@ import { Navigation } from "@components/Navigation/Navigation"; import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; import TrackerSelectColumn from "@components/TrackerSelectColumn/TrackerSelectColumn"; +import AcceptModal from "@components/Modal/AcceptModal/AcceptModal"; import arrow from "assets/icons/arrows/arrowCalendar.png"; import arrowDown from "assets/icons/arrows/selectArrow.png"; @@ -74,6 +75,8 @@ export const ProjectTracker = () => { add: false, edit: false, }); + const [acceptModalOpen, setAcceptModalOpen] = useState(false); + const [currentColumnDelete, setCurrentColumnDelete] = useState(null) const [color, setColor] = useState("#aabbcc"); const [tagInfo, setTagInfo] = useState({ description: "", name: "" }); const [checkBoxParticipateTasks, setCheckBoxParticipateTasks] = @@ -420,6 +423,10 @@ export const ProjectTracker = () => { } }; + function closeAcceptModal() { + setAcceptModalOpen(false); + } + return (
@@ -905,7 +912,15 @@ export const ProjectTracker = () => {
deleteColumn(column)} + onClick={() => { + if (column.tasks.length) { + setAcceptModalOpen(true) + setCurrentColumnDelete(column) + } else { + deleteColumn(column) + } + } + } > delete Удалить @@ -1051,6 +1066,13 @@ export const ProjectTracker = () => { )}
+ {acceptModalOpen && ( + deleteColumn(currentColumnDelete)} + /> + )}
);