From 88162816c5e3a03fa488fb4794ec5c4a193e4694 Mon Sep 17 00:00:00 2001 From: M1kola Date: Thu, 27 Apr 2023 14:51:01 +0300 Subject: [PATCH] tracker --- src/components/UI/ModalCreate/ModalCreate.js | 18 +++++++++++++++--- src/pages/Tracker/Tracker.js | 17 +++++++++++++---- src/pages/Tracker/tracker.scss | 4 +++- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/src/components/UI/ModalCreate/ModalCreate.js b/src/components/UI/ModalCreate/ModalCreate.js index de7d8813..47ac2d03 100644 --- a/src/components/UI/ModalCreate/ModalCreate.js +++ b/src/components/UI/ModalCreate/ModalCreate.js @@ -1,6 +1,7 @@ import React, { useState } from "react"; import { useDispatch } from "react-redux"; import { setProject } from "../../../redux/projectsTrackerSlice"; +import {apiRequest} from "../../../api/request"; import "./ModalCreate.scss"; @@ -16,9 +17,20 @@ export const ModalCreate = ({ active, setActive, title }) => { name: inputValue, count: 0, }; - dispatch(setProject(newItem)); - setActive(false); - setInputValue(""); + apiRequest('/project/create', { + method: 'POST', + data: { + user_id: localStorage.getItem('id'), + name: inputValue, + status: 1, + // description: '', + // company_id: 3 + } + }).then((res) => { + dispatch(setProject(newItem)); + setActive(false); + setInputValue(""); + }) } } diff --git a/src/pages/Tracker/Tracker.js b/src/pages/Tracker/Tracker.js index 4535d567..fac2d70d 100644 --- a/src/pages/Tracker/Tracker.js +++ b/src/pages/Tracker/Tracker.js @@ -23,9 +23,12 @@ import search from "../../images/serchIcon.png"; import noProjects from "../../images/noProjects.png"; import arrow from "../../images/arrowCalendar.png"; -import "./tracker.scss"; +import {apiRequest} from "../../api/request"; import { Navigation } from "../../components/Navigation/Navigation"; + +import "./tracker.scss"; + export const Tracker = () => { const [toggleTab, setToggleTab] = useState(1); const [tabTaskMok, setTabTaskMok] = useState([ @@ -385,6 +388,12 @@ export const Tracker = () => { false, ]); + useEffect(() => { + apiRequest(`/project/project-list?user_id=${localStorage.getItem('id')}&expand=columns`).then((el) => { + + }) + }, []) + const projects = useSelector(getProjects); const toggleTabs = (index) => { @@ -689,7 +698,7 @@ export const Tracker = () => {
setModalCreateColl(true)}>+ -

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

+

добавить колонку

avatar @@ -698,10 +707,10 @@ export const Tracker = () => { + -

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

+

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

- Учавствую + Участвую arrow
diff --git a/src/pages/Tracker/tracker.scss b/src/pages/Tracker/tracker.scss index bc765bdc..9aefe3cb 100644 --- a/src/pages/Tracker/tracker.scss +++ b/src/pages/Tracker/tracker.scss @@ -250,6 +250,8 @@ font-size: 14px; line-height: 17px; max-width: 120px; + display: flex; + align-items: center; } } @@ -294,7 +296,7 @@ background: #00c5a8; color: white; font-size: 14px; - left: -35px; + left: -30px; z-index: 1; }