-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To do list - Maja Z #439
base: master
Are you sure you want to change the base?
To do list - Maja Z #439
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is a nice looking app. Good job! No console errors, great! It's good practice to have an h1 at the top of the page to display the main heading of a web page so you might consider adding that :-)
addToDo: (store, action) => { | ||
// store.items.push(action.payload) | ||
store.items = [action.payload, ...store.items]; | ||
localStorage.setItem('toDoList', JSON.stringify(store.items)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you added the localStorage.
Find me in src/app.js! | ||
</div> | ||
<Provider store={store}> | ||
<Wrapper> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The App.js looks nice and clean with the mounted components.
</TopDiv> | ||
<StyledForm onSubmit={onFormSubmit}> | ||
<label htmlFor="addToDoInput"> | ||
Time to add a new task to the list and get things done <br /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure why you've added the
here but instead of
you could use a
for every new paragraph (best practice) :-))
justify-content: center; | ||
` | ||
|
||
export default function DateToday() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch with the current date.
@@ -0,0 +1,77 @@ | |||
import styled from 'styled-components'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of a global component.
<li key={singleToDo.id}> | ||
<ToDoListBox> | ||
<LeftToDo> | ||
<input id={`toDo_with_id${singleToDo.id}`} type="checkbox" value={singleToDo.IsDone} onChange={() => onIsDoneCheckboxToggle(singleToDo.id)} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To increase user accessibility and make the page more user-friendly you can connect the label with the checkbox so that the user can click on the text for the checkbox and not just on the actual checkbox. I think you need to wrap the text (that you have in a span maybe?) inside of the label. You might also want to add a focus to the checkbox in CSS so that keyboard users see where they are when tabbing.
code/src/index.css
Outdated
position: absolute; | ||
width: 25px; | ||
height: 25px; | ||
outline: 2px solid var(--buttonGreen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wave complains about color contrast errors for the checkboxes, consider using a darker color for the checkbox borders.
import { useSelector } from 'react-redux' | ||
import { BottomToDo, HCounter } from './GlobalStyles'; | ||
|
||
const Counter = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get the counter working you need to start the counter at 0. You can try something like this:
`const Counter = () => {
const todos = useSelector((store) => store.todos.items);
const completedTodos = todos.filter((todo) => todo.isDone);
return (
Completed todos: {completedTodos.length}
);
};
`
…tamp of the new todo with date-fns
https://musical-bubblegum-d9620c.netlify.app/