удалила лишние строки

parent d8ebe16e
......@@ -152,6 +152,20 @@ export default function EnhancedTable() {
});
});
};
const onToggleEditModeDone = id => {
if (readOnly==true) {setReadOnly(false)} else {setReadOnly(true)}
setTasks(state => {
return tasks.map(task => {
if (task.id === id) {
React.dispatch(addTask(task))
return { ...task, isEditMode: !task.isEditMode };
}
return task;
});
});
};
const onChange = (e, task) => {
const value = e.target.value;
......@@ -216,7 +230,8 @@ export default function EnhancedTable() {
accomplish:" "
}
)
setTasks(newTasks)
setTasks(newTasks);
};
return (
......@@ -292,7 +307,7 @@ export default function EnhancedTable() {
<IconButton
aria-label="done"
onClick={() => onToggleEditMode(task.id)}
onClick={() => onToggleEditModeDone(task.id)}
>
<Done/>
</IconButton>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment