Skip to content
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 #1514

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

VictorKomara
Copy link

Copy link

@volodymyr-soltys97 volodymyr-soltys97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job 👍
Let's make your code better

Comment on lines 59 to 86
return (
<div
data-cy="Todo"
className={classNames('todo', { completed: completed })}
key={id}
>
<label className="todo__status-label">
<input
data-cy="TodoStatus"
type="checkbox"
className="todo__status"
checked={completed}
onClick={() => {
changeTodo({ ...todo, completed: !completed });
setUpdatingAndDeletingCompletedTodos([todo]);
}}
/>
</label>

{editingTitle === id ? (
<FormEditingTitle
todo={todo}
titleEdit={titleEdit}
setTitleEdit={setTitleEdit}
handleChangeSubmit={handleChangeSubmit}
setEditingTitle={setEditingTitle}
/>
) : (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this logic to the TodoItem component

Comment on lines 132 to 159
<div data-cy="Todo" className="todo">
<label className="todo__status-label">
<input
data-cy="TodoStatus"
type="checkbox"
className="todo__status"
/>
</label>

<span data-cy="TodoTitle" className="todo__title">
{tempTodo}
</span>

{/* Remove button appears only on hover */}
<button type="button" className="todo__remove" data-cy="TodoDelete">
x
</button>

{/* overlay will cover the todo while it is being deleted or updated */}
<div data-cy="TodoLoader" className="modal overlay is-active">
<div
className={classNames(
'modal-background',
'has-background-white-ter',
)}
/>
<div className="loader" />
</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move these logic to the separate component

);
})}

{tempTodo && <TempTodoItem tempTodo={tempTodo} />}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u can use TodoItem component here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants