-
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
Todo app with api #766
base: master
Are you sure you want to change the base?
Todo app with api #766
Conversation
src/index.tsx
Outdated
|
||
createRoot(document.getElementById('root') as HTMLDivElement) | ||
.render(<App />); | ||
.render(USER_ID ? <App /> : <UserWarning />); |
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.
better to add some condition in App component and not touch the index.ts file
src/components/TodoList/TodoList.tsx
Outdated
import { TodoItem } from '../TodoItem/TodoItem'; | ||
import { Todo } from '../../types/Todo'; | ||
import { TempoTodoItem } from '../TempoTodoItem/TempoTodoItem'; | ||
// import { useState } from 'react'; |
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.
remove all comments
src/App.tsx
Outdated
className={errorMessage | ||
? 'notification is-danger is-light has-text-weight-normal' | ||
: 'notification is-danger is-light has-text-weight-normal hidden'} |
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.
better to use classNames package for such cases
src/App.tsx
Outdated
className={classNames('todoapp__clear-completed', { | ||
'todoapp__clear-completed--hidden': completedTodosCount === 0, | ||
})} | ||
onClick={() => handleClearCompletedTodos()} |
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={() => handleClearCompletedTodos()} | |
onClick={handleClearCompletedTodos} |
we can simplify it
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
DEMO LINK