-
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
add task solution #1076
base: master
Are you sure you want to change the base?
add task solution #1076
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/TodoItem.tsx
Outdated
}, [isEditing, focusInput]); | ||
|
||
return ( | ||
<li className={`todo ${todo.completed ? 'completed' : ''}`} data-cy="Todo"> |
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.
Use the classnames library for add classes with condition, fix it everywhere
src/components/TodoItem.tsx
Outdated
<li className={`todo ${todo.completed ? 'completed' : ''}`} data-cy="Todo"> | ||
<label className="todo__status-label"> | ||
<input | ||
id={`todo-${todo.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.
Use destructuring for todo
src/components/TodoItem.tsx
Outdated
onClick={() => { | ||
deleteTodo(todo.id); | ||
focusInput(); | ||
}} |
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.
Move this logic from jsx to the handle function and use it here
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.
Great work! 🔥
DEMO LINK