fixed all task table

This commit is contained in:
MaxOvs19 2024-02-07 17:33:24 +03:00
parent 455be87e26
commit 92687e05b2

View File

@ -1,16 +1,18 @@
import React from "react"; import React, { useState } from "react";
import plus from "assets/icons/plus.svg"; import plus from "assets/icons/plus.svg";
import "./allTaskTableItem.scss"; import "./allTaskTableItem.scss";
const AllTaskTableItem = ({ task, projects }) => { const AllTaskTableItem = ({ task, projects }) => {
function toggleDescTask(e) { const [desc, setDesc] = useState(false);
e.target?.classList.toggle("open-desc-item");
e.target function toggleDescTask() {
.closest("td") if (desc) {
?.querySelector(".taskList__table__name-project") setDesc(false);
.classList.toggle("hide-desc"); } else {
setDesc(true);
}
} }
return ( return (
@ -22,12 +24,17 @@ const AllTaskTableItem = ({ task, projects }) => {
<img <img
src={plus} src={plus}
alt="#" alt="#"
onClick={(e) => { onClick={toggleDescTask}
toggleDescTask(e); className={desc ? "open-desc-item" : ""}
}}
/> />
</div> </div>
<div className="taskList__table__name-project hide-desc"> <div
className={
desc
? "taskList__table__name-project"
: "taskList__table__name-project hide-desc"
}
>
<h4>Проект:</h4> <h4>Проект:</h4>
<p> <p>
{projects?.map((project) => { {projects?.map((project) => {