diff --git a/devboard/client/src/components/Board/Column.jsx b/devboard/client/src/components/Board/Column.jsx index 0ae2ae4..546a351 100644 --- a/devboard/client/src/components/Board/Column.jsx +++ b/devboard/client/src/components/Board/Column.jsx @@ -17,6 +17,7 @@ const Column = ({ isActive, }) => { const [sorted, setSorted] = useState(false); + const [collapsed, setCollapsed] = useState(false); const [animate, setAnimate] = useState(false); useEffect(() => { @@ -30,7 +31,6 @@ const Column = ({ const displayTasks = sorted ? [...tasks].sort((a, b) => { const order = { high: 0, medium: 1, low: 2 }; - return (order[a.priority] ?? 3) - (order[b.priority] ?? 3); }) : tasks; @@ -66,39 +66,52 @@ const Column = ({ - +
+ + + +
- {/* Droppable cards area */} + {/* Droppable cards area (kept mounted so drag-and-drop still works) */} {(provided, snapshot) => (
- {tasks.length === 0 ? ( -
- No tasks here — drag one in or click + Add card -
- ) : ( - displayTasks.map((task, index) => ( - - )) - )} - + {!collapsed && + (tasks.length === 0 ? ( +
+ No tasks here — drag one in or click + Add card +
+ ) : ( + displayTasks.map((task, index) => ( + + )) + ))} {provided.placeholder}
)} @@ -115,4 +128,4 @@ const Column = ({ ); }; -export default Column; \ No newline at end of file +export default Column;