-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 #1543
base: master
Are you sure you want to change the base?
add task solution #1543
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.
Great job! 👍
Looks good to me 😃
src/App.tsx
Outdated
setErrorMessage('Unable to add a 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.
try to make enum
for all errors
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 approving it, will left more comments in the next iteration!
export const USER_ID = 2125; | ||
|
||
export const getTodos = () => { | ||
return client.get<Todo[]>(`/todos?userId=${USER_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.
let's move /todos into constant and reuse
return () => clearTimeout(timer); | ||
} | ||
|
||
return undefined; |
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.
do we really need to return undefined here?
{filterLinks.map(({ label, value }) => ( | ||
<a | ||
key={value} | ||
href={`#/${value}`} | ||
className={cn('filter__link', { selected: filterStatus === value })} | ||
data-cy={`FilterLink${label}`} | ||
onClick={() => setFilterStatus(value)} | ||
> | ||
{label} | ||
</a> | ||
))} |
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.
that's good!
DEMO LINK