Skip to content

solution#2259

Open
Kit3AWP wants to merge 2 commits into
mate-academy:masterfrom
Kit3AWP:develop
Open

solution#2259
Kit3AWP wants to merge 2 commits into
mate-academy:masterfrom
Kit3AWP:develop

Conversation

@Kit3AWP

@Kit3AWP Kit3AWP commented Jun 24, 2026

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.

almost done

Comment thread src/App.tsx Outdated
const [todos, setTodos] = useState<Todo[]>([]);
const [, setIsLoading] = useState(true);
const [errorMessage, setErrorMessage] = 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.

it would be better to create an enum for the filter parameters

Comment thread src/App.tsx Outdated

setTodos(data);
} catch (error) {
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.

create an enum for errors as well

Comment thread src/App.tsx Outdated
Comment on lines +119 to +124
const handleClearCompleted = () => {
const completedTodos = todos.filter(todo => todo.completed);

completedTodos.forEach(todo => {
handleDelete(todo.id);
});

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 promise.all() here

Comment thread src/App.tsx Outdated
Comment on lines +158 to +167
const handleToggleAll = () => {
const shouldBeCompleted = !todos.every(todo => todo.completed);
const todosToUpdate = todos.filter(
todo => todo.completed !== shouldBeCompleted,
);

todosToUpdate.forEach(todo => {
handleToggle(todo.id, shouldBeCompleted);
});
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

use Promise.all() here as well

@Kit3AWP Kit3AWP requested a review from etojeDenys June 25, 2026 10:38

@brespect brespect 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 progress, but can't reach your DEMO LINK

@Kit3AWP Kit3AWP requested a review from brespect June 25, 2026 12:15

@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