Skip to content

version 1#2410

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

version 1#2410
dianakomar wants to merge 3 commits into
mate-academy:masterfrom
dianakomar:develop

Conversation

@dianakomar

Copy link
Copy Markdown

@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, to improve:

  1. split the app into several components

Comment thread src/App.tsx Outdated
useEffect(() => {
getTodos()
.then(setTodos)
.catch(() => showErrorMessage('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.

it would be better to create an enum for errors

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

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

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

you can create an array with the needed parameters and then map through it to create links and avoid code repetition

@dianakomar dianakomar requested a review from etojeDenys June 20, 2026 11:07

@Denys-Kravchuk9988 Denys-Kravchuk9988 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!

A few things to improve:

Comment thread src/components/TodoItem.tsx Outdated
<div
key={todo.id}
data-cy="Todo"
className={`todo ${todo.completed ? 'completed' : ''}`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's better to use classNames here

Comment thread src/App.tsx Outdated
<div
data-cy="ErrorNotification"
className="notification is-danger is-light has-text-weight-normal"
className={`notification is-danger is-light has-text-weight-normal ${!error ? 'hidden' : ''}`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's better to use classNames here

@Anton-Kuchmasov Anton-Kuchmasov 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.

Well done!

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.

4 participants