This commit is contained in:
Николай Полтщук 2023-08-04 23:24:18 +03:00
parent 3db87fca20
commit 03071a7f91
2 changed files with 40 additions and 28 deletions

View File

@ -5,32 +5,41 @@ import { moveProjectTask } from "@redux/projectsTrackerSlice";
import arrowDown from "assets/icons/arrows/selectArrow.png"; import arrowDown from "assets/icons/arrows/selectArrow.png";
import './trackerSelectColumn.scss' import "./trackerSelectColumn.scss";
export const TrackerSelectColumn = ({columns, task, currentColumn}) => { export const TrackerSelectColumn = ({ columns, task, currentColumn }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const [openSelect, setOpenSelect] = useState(false) const [openSelect, setOpenSelect] = useState(false);
return( return (
<div className='trackerSelectColumn' onClick={() => setOpenSelect(!openSelect)}> <div
<p>Выберите колонку</p> className="trackerSelectColumn"
<img className={openSelect ? 'open' : ''} src={arrowDown} alt='arrow' /> onClick={() => setOpenSelect(!openSelect)}
{openSelect && >
<div className='trackerSelectColumn__dropDown'> <p>Выберите колонку</p>
{columns.map((column) => { <img className={openSelect ? "open" : ""} src={arrowDown} alt="arrow" />
return <p key={column.id} onClick={() => { {openSelect && (
dispatch(moveProjectTask({ <div className="trackerSelectColumn__dropDown">
startWrapperIndex: {index: currentColumn, task}, {columns.map((column) => {
columnId: column.id return (
})) <p
} key={column.id}
}>{column.title}</p> onClick={() => {
dispatch(
moveProjectTask({
startWrapperIndex: { index: currentColumn, task },
columnId: column.id,
}) })
} );
</div> }}
} >
{column.title}
</p>
);
})}
</div> </div>
) )}
</div>
);
}; };
export default TrackerSelectColumn; export default TrackerSelectColumn;

View File

@ -194,8 +194,8 @@ export const ProjectTracker = () => {
} }
function openTicket(e, task) { function openTicket(e, task) {
if (window. innerWidth < 900) { if (window.innerWidth < 900) {
return return;
} }
setSelectedTicket(task); setSelectedTicket(task);
setModalActiveTicket(true); setModalActiveTicket(true);
@ -687,9 +687,12 @@ export const ProjectTracker = () => {
</div> </div>
</div> </div>
<TrackerSelectColumn <TrackerSelectColumn
columns={projectBoard.columns.filter((item) => item.id !== column.id)} columns={projectBoard.columns.filter(
currentColumn={column.id} (item) => item.id !== column.id
task={task} /> )}
currentColumn={column.id}
task={task}
/>
</div> </div>
); );
})} })}