-
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 #1089
base: master
Are you sure you want to change the base?
Develop #1089
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 it looks good, but let's improve your solution a bit more!
src/UserWarning.tsx
Outdated
// import React from 'react'; | ||
|
||
// export const UserWarning: React.FC = () => ( | ||
// <section className="section"> | ||
// <p className="box is-size-3"> | ||
// Please get your <b> userId </b>{' '} | ||
// <a href="https://mate-academy.github.io/react_student-registration"> | ||
// here | ||
// </a>{' '} | ||
// and save it in the app <pre>const USER_ID = ...</pre> | ||
// All requests to the API must be sent with this | ||
// <b> userId.</b> | ||
// </p> | ||
// </section> | ||
// ); |
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 redundant comments
type="button" | ||
className="todoapp__clear-completed" | ||
data-cy="ClearCompletedButton" | ||
disabled={todos.length === completedTodosLength} |
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.
disabled={todos.length === completedTodosLength} | |
disabled={completedTodosLength === 0} |
it seems that it will be more informative
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/Header.tsx
Outdated
<header className="todoapp__header"> | ||
{!!todos.length && ( | ||
<button | ||
onClick={() => changeCompleteAll()} |
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={() => changeCompleteAll()} | |
onClick={changeCompleteAll} |
can be a bit simplify
src/hooks/useForm.tsx
Outdated
|
||
const handleAddTodo = async (event: React.FormEvent<HTMLFormElement>) => { | ||
event.preventDefault(); | ||
if (query.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.
query.trim()
move into const and reuse
I changed the code a bit, rewrote it, added 'reduce' |
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.
Well done!)
DEMO LINK
I don't know, I passed all 118 tests 😳