fixed all task table
This commit is contained in:
parent
455be87e26
commit
92687e05b2
@ -1,16 +1,18 @@
|
||||
import React from "react";
|
||||
import React, { useState } from "react";
|
||||
|
||||
import plus from "assets/icons/plus.svg";
|
||||
|
||||
import "./allTaskTableItem.scss";
|
||||
|
||||
const AllTaskTableItem = ({ task, projects }) => {
|
||||
function toggleDescTask(e) {
|
||||
e.target?.classList.toggle("open-desc-item");
|
||||
e.target
|
||||
.closest("td")
|
||||
?.querySelector(".taskList__table__name-project")
|
||||
.classList.toggle("hide-desc");
|
||||
const [desc, setDesc] = useState(false);
|
||||
|
||||
function toggleDescTask() {
|
||||
if (desc) {
|
||||
setDesc(false);
|
||||
} else {
|
||||
setDesc(true);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@ -22,12 +24,17 @@ const AllTaskTableItem = ({ task, projects }) => {
|
||||
<img
|
||||
src={plus}
|
||||
alt="#"
|
||||
onClick={(e) => {
|
||||
toggleDescTask(e);
|
||||
}}
|
||||
onClick={toggleDescTask}
|
||||
className={desc ? "open-desc-item" : ""}
|
||||
/>
|
||||
</div>
|
||||
<div className="taskList__table__name-project hide-desc">
|
||||
<div
|
||||
className={
|
||||
desc
|
||||
? "taskList__table__name-project"
|
||||
: "taskList__table__name-project hide-desc"
|
||||
}
|
||||
>
|
||||
<h4>Проект:</h4>
|
||||
<p>
|
||||
{projects?.map((project) => {
|
||||
|
Loading…
Reference in New Issue
Block a user