diff --git a/src/components/ProjectTiket/ProjectTiket.jsx b/src/components/ProjectTiket/ProjectTiket.jsx index 07a963f7..caa5c354 100644 --- a/src/components/ProjectTiket/ProjectTiket.jsx +++ b/src/components/ProjectTiket/ProjectTiket.jsx @@ -5,7 +5,7 @@ import { apiRequest } from "../../api/request"; import { deleteProject, modalToggle } from "../../redux/projectsTrackerSlice"; import { ModalSelect } from "../UI/ModalSelect/ModalSelect"; -import ModalAdd from "../UI/ModalAdd/ModalAdd"; +import TrackerModal from "../UI/TrackerModal/TrackerModal"; import link from "../../images/link.svg"; import archiveSet from "../../images/archive.svg"; @@ -67,11 +67,11 @@ export const ProjectTiket = ({ project, index }) => { - + >
diff --git a/src/components/UI/ModalAspt/ModalAspt.jsx b/src/components/UI/ModalAspt/ModalAspt.jsx index d299e6c3..aa60b69e 100644 --- a/src/components/UI/ModalAspt/ModalAspt.jsx +++ b/src/components/UI/ModalAspt/ModalAspt.jsx @@ -1,13 +1,13 @@ import React, { useState } from "react"; +import { Link } from "react-router-dom"; +import ModalLayout from "../ModalLayout/ModalLayout"; + import avatar from "../../../images/mokPerson.png"; import logoTg from "../../../images/TgLogo.svg"; import arrow from "../../../images/right-arrow.png"; import interview from "../../../images/interviewLogo.svg"; -import { Link } from "react-router-dom"; -import ModalAdd from "../ModalAdd/ModalAdd"; - import "./modalAspt.scss"; export const ModalAspt = ({ active, setActive, level }) => { @@ -82,7 +82,8 @@ export const ModalAspt = ({ active, setActive, level }) => {
setActive(false)}> - + +

Спасибо, собеседование назначено

@@ -93,7 +94,7 @@ export const ModalAspt = ({ active, setActive, level }) => { Время собеседования: {time}

-
+ ); }; diff --git a/src/components/UI/ModalCreate/ModalCreate.jsx b/src/components/UI/ModalCreate/ModalCreate.jsx deleted file mode 100644 index b2a3fa27..00000000 --- a/src/components/UI/ModalCreate/ModalCreate.jsx +++ /dev/null @@ -1,60 +0,0 @@ -import React, { useState } from "react"; -import { useDispatch } from "react-redux"; -import { setProject } from "../../../redux/projectsTrackerSlice"; -import {apiRequest} from "../../../api/request"; - -import "./ModalCreate.scss"; - -export const ModalCreate = ({ active, setActive, title }) => { - const [inputValue, setInputValue] = useState(""); - const dispatch = useDispatch(); - - function createName() { - if (inputValue === "") { - return; - } else { - apiRequest('/project/create', { - method: 'POST', - data: { - user_id: localStorage.getItem('id'), - name: inputValue, - status: 1, - } - }).then((res) => { - const result = {...res, columns: []} - dispatch(setProject(result)); - setActive(false); - setInputValue(""); - }) - } - } - - return ( -
setActive(false)} - > -
e.stopPropagation()} - > -
-

{title}

-
- setInputValue(e.target.value)} - /> -
- -
- setActive(false)}> -
-
- ); -}; - -export default ModalCreate; diff --git a/src/components/UI/ModalCreate/ModalCreate.scss b/src/components/UI/ModalCreate/ModalCreate.scss deleted file mode 100644 index 5139572e..00000000 --- a/src/components/UI/ModalCreate/ModalCreate.scss +++ /dev/null @@ -1,77 +0,0 @@ -.modal-project { - z-index: 9999; - height: 100%; - width: 100%; - background-color: rgba(0, 0, 0, 0.11); - position: fixed; - top: 0; - left: 0; - display: flex; - align-items: center; - justify-content: center; - transform: scale(0); - - &__content { - position: relative; - width: 424px; - height: 248px; - background: linear-gradient(180deg, #ffffff 0%, #ebebeb 100%); - border-radius: 40px; - - padding: 15px; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - - .title-project { - display: flex; - align-items: flex-start; - flex-direction: column; - - .input-container { - width: 287px; - height: 35px; - background: #ffffff; - border-radius: 8px; - } - - h4 { - font-weight: 500; - font-size: 22px; - line-height: 26px; - color: #263238; - margin-bottom: 22px; - } - } - - .name-project { - margin-left: 10px; - border: none; - outline: none; - height: 100%; - width: 90%; - font-size: 14px; - } - - .create-project { - margin: 30px 0 0 0; - width: 130px; - height: 37px; - background: #52b709; - border-radius: 44px; - border: none; - font-weight: 400; - font-size: 15px; - line-height: 32px; - color: #ffffff; - display: flex; - align-items: center; - justify-content: center; - } - } -} - -.modal-project.active { - transform: scale(1); -} diff --git a/src/components/UI/ModalLayout/ModalLayout.jsx b/src/components/UI/ModalLayout/ModalLayout.jsx new file mode 100644 index 00000000..40e5fbae --- /dev/null +++ b/src/components/UI/ModalLayout/ModalLayout.jsx @@ -0,0 +1,16 @@ +import React from "react"; + +export const ModalLayout = ({ active, setActive, children }) => { + return ( +
setActive(false)} + > +
e.stopPropagation()}> + {children} +
+
+ ); +}; + +export default ModalLayout; diff --git a/src/components/UI/ModalTicket/ModalTicket.jsx b/src/components/UI/ModalTicket/ModalTicket.jsx index 04c968d2..cee567d2 100644 --- a/src/components/UI/ModalTicket/ModalTicket.jsx +++ b/src/components/UI/ModalTicket/ModalTicket.jsx @@ -1,9 +1,12 @@ import React, { useState } from "react"; import { Link } from "react-router-dom"; -import ModalAdd from "../ModalAdd/ModalAdd"; +import TrackerModal from "../TrackerModal/TrackerModal"; import { apiRequest } from "../../../api/request"; import { useDispatch } from "react-redux"; -import { setProjectBoardFetch } from "../../../redux/projectsTrackerSlice"; +import { + modalToggle, + setProjectBoardFetch, +} from "../../../redux/projectsTrackerSlice"; import category from "../../../images/category.png"; import watch from "../../../images/watch.png"; @@ -56,7 +59,10 @@ export const ModalTiсket = ({

Проект: {projectName} - +

@@ -71,7 +77,12 @@ export const ModalTiсket = ({

- @@ -97,14 +108,15 @@ export const ModalTiсket = ({ {task.title}

Создатель : {task.user?.fio}

- {Boolean(task.taskUsers?.length) && task.taskUsers.map((worker, index) => { - return ( -
- -

{worker.name}

-
- ); - })} + {Boolean(task.taskUsers?.length) && + task.taskUsers.map((worker, index) => { + return ( +
+ +

{worker.name}

+
+ ); + })}
@@ -145,20 +157,12 @@ export const ModalTiсket = ({
- -
-

- Вы добавляете подзадачу

в колонку задачи {"Готово"}

-

-

Введите текст

-
- -
-
- -
+ + ); }; diff --git a/src/components/UI/TicketFullScreen/TicketFullScreen.jsx b/src/components/UI/TicketFullScreen/TicketFullScreen.jsx index 68503758..008b16a9 100644 --- a/src/components/UI/TicketFullScreen/TicketFullScreen.jsx +++ b/src/components/UI/TicketFullScreen/TicketFullScreen.jsx @@ -4,11 +4,11 @@ import { ProfileHeader } from "../../ProfileHeader/ProfileHeader"; import { ProfileBreadcrumbs } from "../../ProfileBreadcrumbs/ProfileBreadcrumbs"; import { Footer } from "../../Footer/Footer"; import { Link, useParams, useNavigate } from "react-router-dom"; -import ModalAdd from "../ModalAdd/ModalAdd"; +import TrackerModal from "../TrackerModal/TrackerModal"; import { Navigation } from "../../Navigation/Navigation"; import { useDispatch } from "react-redux"; -import { setToggleTab } from "../../../redux/projectsTrackerSlice"; +import { modalToggle, setToggleTab } from "../../../redux/projectsTrackerSlice"; import { apiRequest } from "../../../api/request"; import project from "../../../images/trackerProject.svg"; @@ -31,9 +31,7 @@ import edit from "../../../images/edit.svg"; import "./ticketFullScreen.scss"; export const TicketFullScreen = ({}) => { - const [addSubtask, setAddSubtask] = useState(false); const [modalAddWorker, setModalAddWorker] = useState(false); - const [valueTiket, setValueTiket] = useState(""); const ticketId = useParams(); const dispatch = useDispatch(); const navigate = useNavigate(); @@ -114,31 +112,22 @@ export const TicketFullScreen = ({}) => {

Проект : {projectInfo.name}

- -
-

Добавьте участника

-

Введите имя или e-mail

-
- setValueTiket(e.target.value)} - > -
-
- -
+
avatar avatar +9 - + { + dispatch(modalToggle("addWorker")); + setModalAddWorker(true); + }} + > +

добавить участника в проект

@@ -172,7 +161,12 @@ export const TicketFullScreen = ({}) => {

- @@ -210,7 +204,14 @@ export const TicketFullScreen = ({}) => {

- + Добавить участников
@@ -247,21 +248,6 @@ export const TicketFullScreen = ({}) => { - - -
-

- Вы добавляете подзадачу

в колонку задачи {"Готово"}

-

-

Введите текст

-
- -
-
- -