From 03071a7f91a1bee9b70b3531d42c255a0446940f Mon Sep 17 00:00:00 2001 From: M1kola Date: Fri, 4 Aug 2023 23:24:18 +0300 Subject: [PATCH] adaptive --- .../TrackerSelectColumn.jsx | 55 +++++++++++-------- src/pages/ProjectTracker/ProjectTracker.js | 13 +++-- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx b/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx index 08452e86..3fd9fcab 100644 --- a/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx +++ b/src/components/TrackerSelectColumn/TrackerSelectColumn.jsx @@ -5,32 +5,41 @@ import { moveProjectTask } from "@redux/projectsTrackerSlice"; import arrowDown from "assets/icons/arrows/selectArrow.png"; -import './trackerSelectColumn.scss' +import "./trackerSelectColumn.scss"; -export const TrackerSelectColumn = ({columns, task, currentColumn}) => { - const dispatch = useDispatch(); - const [openSelect, setOpenSelect] = useState(false) - return( -
setOpenSelect(!openSelect)}> -

Выберите колонку

- arrow - {openSelect && -
- {columns.map((column) => { - return

{ - dispatch(moveProjectTask({ - startWrapperIndex: {index: currentColumn, task}, - columnId: column.id - })) - } - }>{column.title}

+export const TrackerSelectColumn = ({ columns, task, currentColumn }) => { + const dispatch = useDispatch(); + const [openSelect, setOpenSelect] = useState(false); + return ( +
setOpenSelect(!openSelect)} + > +

Выберите колонку

+ arrow + {openSelect && ( +
+ {columns.map((column) => { + return ( +

{ + dispatch( + moveProjectTask({ + startWrapperIndex: { index: currentColumn, task }, + columnId: column.id, }) - } -

- } + ); + }} + > + {column.title} +

+ ); + })}
- ) + )} +
+ ); }; export default TrackerSelectColumn; - diff --git a/src/pages/ProjectTracker/ProjectTracker.js b/src/pages/ProjectTracker/ProjectTracker.js index 8eb2fafe..ff2374de 100644 --- a/src/pages/ProjectTracker/ProjectTracker.js +++ b/src/pages/ProjectTracker/ProjectTracker.js @@ -194,8 +194,8 @@ export const ProjectTracker = () => { } function openTicket(e, task) { - if (window. innerWidth < 900) { - return + if (window.innerWidth < 900) { + return; } setSelectedTicket(task); setModalActiveTicket(true); @@ -687,9 +687,12 @@ export const ProjectTracker = () => {
item.id !== column.id)} - currentColumn={column.id} - task={task} /> + columns={projectBoard.columns.filter( + (item) => item.id !== column.id + )} + currentColumn={column.id} + task={task} + /> ); })}