From ce939e6322442a60620b6f6559bb534c64463726 Mon Sep 17 00:00:00 2001 From: MaxOvs19 Date: Fri, 5 May 2023 16:10:25 +0300 Subject: [PATCH] Finished fixed modal --- src/components/ProjectTiket/ProjectTiket.jsx | 6 +- src/components/UI/ModalAspt/ModalAspt.jsx | 11 +- src/components/UI/ModalLayout/ModalLayout.jsx | 16 ++ src/components/UI/ModalTicket/ModalTicket.jsx | 6 +- .../UI/TicketFullScreen/TicketFullScreen.jsx | 68 +++--- .../TrackerModal.jsx} | 18 +- .../trackerModal.scss} | 0 src/pages/PartnerBid/PartnerBid.jsx | 6 +- src/pages/ProjectTracker/ProjectTracker.js | 228 +++++++++--------- src/pages/Tracker/Tracker.js | 6 +- 10 files changed, 183 insertions(+), 182 deletions(-) create mode 100644 src/components/UI/ModalLayout/ModalLayout.jsx rename src/components/UI/{ModalAdd/ModalAdd.jsx => TrackerModal/TrackerModal.jsx} (98%) rename src/components/UI/{ModalAdd/modalAdd.scss => TrackerModal/trackerModal.scss} (100%) 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/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 145ae3a2..cee567d2 100644 --- a/src/components/UI/ModalTicket/ModalTicket.jsx +++ b/src/components/UI/ModalTicket/ModalTicket.jsx @@ -1,6 +1,6 @@ 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 { @@ -158,11 +158,11 @@ 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 = ({}) => { - - -
-

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

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

-

-

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

-
- -
-
- -