-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
create todo app #807
base: master
Are you sure you want to change the base?
create todo app #807
Conversation
src/App.tsx
Outdated
Clear completed | ||
</button> | ||
</footer> | ||
<TodosFilter /> |
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.
<TodosFilter /> | |
<TodosFilter /> |
}, [isEdit]); | ||
|
||
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => { | ||
if (event.key === 'Enter' && editingText) { |
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.
enter is a magic word
Consider will be better if you create a enum for magic words and use it everywhere
const completedFilter = filterTodos.filter((todo: Todos) => todo.completed); | ||
|
||
switch (status) { | ||
case Status.all: |
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.
enum's items should be in camelCase or UPPER_CASE
case Status.all: | |
case Status.All: |
src/Types/Status.tsx
Outdated
completed = '#/completed', | ||
} | ||
|
||
export default Status; |
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.
redundant
export default Status; |
src/Types/Todos.tsx
Outdated
type Todos = { | ||
id: number | ||
title: string | ||
completed: boolean | ||
}; | ||
|
||
export default Todos; |
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.
type Todos = { | |
id: number | |
title: string | |
completed: boolean | |
}; | |
export default Todos; | |
export type Todos = { | |
id: number | |
title: string | |
completed: boolean | |
}; |
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.
<ul className="todo-list" data-cy="todoList"> | ||
{filterTodos.map((todo) => ( | ||
<TodoItem | ||
key={`${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.
key={`${todo.id}`} | |
key={todo.id} |
DEMO LINK