-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
react_todo-app #767
base: master
Are you sure you want to change the base?
react_todo-app #767
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.
src/components/ToggleAll.tsx
Outdated
checked={checkbox} | ||
ref={checkedAllTodo} | ||
readOnly | ||
onClick={() => handeltAll()} |
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.
onClick={() => handeltAll()} | |
onClick={handeltAll} |
src/components/ToggleAll.tsx
Outdated
if (!state.some(elem => elem.completed === false) && state.length > 0) { | ||
setCheckbox(true); | ||
} else { | ||
setCheckbox(false); | ||
} |
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.
if (!state.some(elem => elem.completed === false) && state.length > 0) { | |
setCheckbox(true); | |
} else { | |
setCheckbox(false); | |
} | |
setCheckbox(!state.some(elem => elem.completed === false) && state.length > 0); |
src/components/ToggleAll.tsx
Outdated
if (!checked) { | ||
dispatch({ type: ActionType.toggleAll, payload: !checked }); | ||
} | ||
|
||
if (checked) { | ||
dispatch({ type: ActionType.toggleAll, payload: !checked }); | ||
} |
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.
looks the same, why do we need these if's
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.
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.
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.
Looks good.
Just want to pay attention that footer shouldn't be visible when no any todos.
https://OlegRak86.github.io/react_todo-app/