Conversation
EmmaHoltegaard
left a comment
There was a problem hiding this comment.
Great job, as always. Simple design, but superuser-friendly. Everything seems to work as it should, only minor problem I noticed, is that the input field doesn't clear after you submit a task. Otherwise, everything looks good and your code is clean and easy to read.
|
|
||
|
|
||
|
|
||
| &.completed { |
There was a problem hiding this comment.
Neat way of adding some conditional styling. Didn't know you could target classnames in styled components like this, but it makes sense once you see it.
| dispatch(tasks.actions.completeAllTasks()) | ||
| } | ||
| const handleDeleteAll = () => { | ||
| if (window.confirm('Are you sure you want to delete all?')) { |
There was a problem hiding this comment.
Nice touch adding the window. Adds a lot to the user experience that you can't accidentally just delete everything with a single click.
| todo.complete = !todo.complete | ||
| }, | ||
| deleteTask(state, action) { | ||
| // state = state.filter((t) => t.id !== action.payload) |
There was a problem hiding this comment.
Good job getting around the filter-method (from the live session I got the impression filter() wasn't the best choice for this). Your solution is really nice and not overly complicated (which I love).
No description provided.