Skip to content

add task solution#2194

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

add task solution#2194
AndrewPrszn wants to merge 2 commits into
mate-academy:masterfrom
AndrewPrszn:develop

Conversation

@AndrewPrszn
Copy link
Copy Markdown

Copy link
Copy Markdown

@2pasha 2pasha 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! 👏

take a look on comments below ⬇️

Comment thread src/components/Footer.tsx
Comment on lines +37 to +40
onClick={e => {
e.preventDefault();
setFilter(f.value);
}}
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/components/TodoList.tsx Outdated
Comment on lines +53 to +79
onBlur={async () => {
const trimmed = editedTitle.trim();

if (trimmed === todo.title) {
setEditingId(null);

return;
}

if (!trimmed) {
try {
await onDelete(todo.id);
} catch {
//
}

return;
}

try {
await onRename(todo, trimmed);

setEditingId(null);
} catch {
// keep opened
}
}}
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/components/TodoList.tsx Outdated
Comment on lines +80 to +89
onKeyUp={e => {
if (e.key === 'Escape') {
setEditedTitle(todo.title);
setEditingId(null);
}

if (e.key === 'Enter') {
(e.target as HTMLInputElement).blur();
}
}}
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/components/TodoList.tsx Outdated
Comment on lines +96 to +99
onDoubleClick={() => {
setEditingId(todo.id);
setEditedTitle(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 +18 to +24
enum ErrorMessage {
Load = 'Unable to load todos',
Add = 'Unable to add a todo',
Delete = 'Unable to delete a todo',
EmptyTitle = 'Title should not be empty',
Update = 'Unable to update a 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.

it's better to move to separate file inside types` folder

@AndrewPrszn AndrewPrszn requested a review from 2pasha May 8, 2026 17:03
Copy link
Copy Markdown

@2pasha 2pasha left a comment

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.

2 participants