Skip to content

week 11 - edvard#451

Open
edv-rd wants to merge 13 commits intoTechnigo:masterfrom
edv-rd:master
Open

week 11 - edvard#451
edv-rd wants to merge 13 commits intoTechnigo:masterfrom
edv-rd:master

Conversation

@edv-rd
Copy link
Copy Markdown

@edv-rd edv-rd commented Apr 24, 2023

No description provided.

Copy link
Copy Markdown

@EmmaHoltegaard EmmaHoltegaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?')) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants