Skip to content

Develop#2196

Open
VladChudin wants to merge 4 commits into
mate-academy:masterfrom
VladChudin:develop
Open

Develop#2196
VladChudin wants to merge 4 commits into
mate-academy:masterfrom
VladChudin:develop

Conversation

@VladChudin
Copy link
Copy Markdown

Copy link
Copy Markdown

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

A few things to improve:

  1. It's needed to add loading state clicking on select all caret button (all uncompleted todos should have loading state). The same by click on Clear completed button
Image Image

Comment thread src/components/Footer/Footer.tsx Outdated
<nav className="filter" data-cy="Filter">
<a
href="#/"
className={`filter__link ${filter === 'all' ? 'selected' : ''}`}
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/components/Footer/Footer.tsx Outdated

<a
href="#/active"
className={`filter__link ${filter === 'active' ? 'selected' : ''}`}
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/components/Footer/Footer.tsx Outdated
href="#/"
className={`filter__link ${filter === 'all' ? 'selected' : ''}`}
data-cy="FilterLinkAll"
onClick={() => changeFilter('all')}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would recommend to extract 'all' to a separate enum and use this enum here

Comment thread src/components/Footer/Footer.tsx Outdated

<a
href="#/completed"
className={`filter__link ${filter === 'completed' ? 'selected' : ''}`}
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/components/Footer/Footer.tsx Outdated
href="#/completed"
className={`filter__link ${filter === 'completed' ? 'selected' : ''}`}
data-cy="FilterLinkCompleted"
onClick={() => changeFilter('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.

I would recommend to extract 'completed' to a separate enum and use this enum here

Comment thread src/components/TodoItem/TodoItem.tsx Outdated
};

return (
<div 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/components/TodoItem/TodoItem.tsx Outdated
)}
<div
data-cy="TodoLoader"
className={`modal overlay ${isLoading || isSaving ? 'is-active' : ''}`}
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
{todos.length > 0 && (
<button
type="button"
className={`todoapp__toggle-all ${areAllCompleted ? 'active' : ''}`}
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
{/* Add the 'hidden' class to hide the message smoothly */}
<div
data-cy="ErrorNotification"
className={`${errorMessage ? '' : 'hidden'} notification is-danger is-light has-text-weight-normal`}
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/components/Footer/Footer.tsx Outdated
href="#/active"
className={`filter__link ${filter === 'active' ? 'selected' : ''}`}
data-cy="FilterLinkActive"
onClick={() => changeFilter('active')}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would recommend to extract 'active' to a separate enum and use this enum here

Copy link
Copy Markdown

@etojeDenys etojeDenys left a comment

Choose a reason for hiding this comment

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

almost done

Comment thread src/App.tsx
Comment on lines +104 to +122
const handleToggleAllButton = async () => {
try {
await handleToggleAll();
} catch (error) {
if (error instanceof Error) {
setErrorMessage(error.message);
}
}
};

const handleClearCompleted = async () => {
try {
await clearCompleted();
} catch (error) {
if (error instanceof Error) {
setErrorMessage(error.message);
}
}
};
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 should use the promise.all() here

Comment thread src/App.tsx Outdated
updateTodoTitle,
} = useTodos();
const [fieldValue, setFieldValue] = useState('');
const [filter, setFilter] = useState('all');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

create enum for the filter parameters

Comment thread src/components/Footer/Footer.tsx Outdated
Comment on lines +35 to +66
<a
href="#/"
className={classNames('filter__link', {
selected: filter === FilterType.all,
})}
data-cy="FilterLinkAll"
onClick={() => changeFilter(FilterType.all)}
>
All
</a>

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

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

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

@VladChudin VladChudin requested a review from etojeDenys May 10, 2026 09:51
Copy link
Copy Markdown

@Anton-Kuchmasov Anton-Kuchmasov left a comment

Choose a reason for hiding this comment

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

Awesome!

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