Skip to content

add task P3#2254

Open
ArtemNosachenko wants to merge 3 commits into
mate-academy:masterfrom
ArtemNosachenko:develop
Open

add task P3#2254
ArtemNosachenko wants to merge 3 commits into
mate-academy:masterfrom
ArtemNosachenko:develop

Conversation

@ArtemNosachenko

Copy link
Copy Markdown

@2pasha 2pasha left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good job! 👏

take a look on comments below ⬇️

Comment thread src/App.tsx

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

separate your App to components

Comment thread src/App.tsx Outdated
getTodos()
.then(setTodos)
.catch(() => {
setErrorMessage('Unable to load todos');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

move all your error messages to separate enum

Comment thread src/App.tsx Outdated
Comment on lines +292 to +295
onSubmit={e => {
e.preventDefault();
handleRename(todo);
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

move to separate fn

Comment thread src/App.tsx Outdated
Comment on lines +304 to +308
onKeyUp={e => {
if (e.key === 'Escape') {
setEditingTodoId(null);
}
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

move to separate fn

Comment thread src/App.tsx
Comment on lines +316 to +319
onDoubleClick={() => {
setEditingTodoId(todo.id);
setEditingTitle(todo.title);
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

move to separate fn

Comment thread src/App.tsx Outdated
Comment on lines +358 to +389
<a
href="#/"
data-cy="FilterLinkAll"
className={classNames('filter__link', {
selected: filter === FilterType.All,
})}
onClick={() => setFilter(FilterType.All)}
>
All
</a>

<a
href="#/active"
data-cy="FilterLinkActive"
className={classNames('filter__link', {
selected: filter === FilterType.Active,
})}
onClick={() => setFilter(FilterType.Active)}
>
Active
</a>

<a
href="#/completed"
data-cy="FilterLinkCompleted"
className={classNames('filter__link', {
selected: filter === FilterType.Completed,
})}
onClick={() => setFilter(FilterType.Completed)}
>
Completed
</a>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

DRY
you may add all your filter values to kind of array and map through it

@ArtemNosachenko
ArtemNosachenko requested a review from 2pasha June 23, 2026 15:54

@etojeDenys etojeDenys left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good job, but it would be better if you split the app into several components (for example, header, main section, footer and errorNotification)

@etojeDenys etojeDenys left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm

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