-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Develop #1085
base: master
Are you sure you want to change the base?
Develop #1085
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.
Almost done, let's improve your code a bit more!
src/Store.tsx
Outdated
let updatedTodos = state.allTodos; | ||
|
||
switch (action.type) { | ||
case 'addTodo': { |
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.
let's move addTodo
and other cases to enum and reuse
src/components/Form.tsx
Outdated
|
||
const handleFormSubmit = (event: React.FormEvent<HTMLFormElement>) => { | ||
event.preventDefault(); | ||
if (todoTitle.trim() === '') { |
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 (todoTitle.trim() === '') { | |
if (!!todoTitle.trim()) { |
src/components/Header.tsx
Outdated
|
||
return ( | ||
<header className="todoapp__header"> | ||
{/* this button should have `active` class only if all todos are completed */} |
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.
please remove comment
src/components/TodoItem.tsx
Outdated
/* eslint-disable jsx-a11y/label-has-associated-control */ | ||
/* eslint-disable jsx-a11y/control-has-associated-label */ |
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.
can we remove this?
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 like a masterpiece!
DEMO LINK