Skip to content

solution#2413

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

solution#2413
Kit3AWP wants to merge 3 commits into
mate-academy:masterfrom
Kit3AWP:develop

Conversation

@Kit3AWP

@Kit3AWP Kit3AWP commented Jun 21, 2026

Copy link
Copy Markdown

@vitalii-bondarenko-ua vitalii-bondarenko-ua 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.

  • fix linter error
Image
  • Split App component into separate smaller components (Header, Footer, TodoList, TodoItem, 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.

good job, just a few fixes
also here is your demo

Comment thread src/components/Footer.tsx Outdated
Comment on lines +17 to +51
<a
href="#/"
className={`filter__link ${filter === 'all' ? 'selected' : ''}`}
data-cy="FilterLinkAll"
onClick={event => {
event.preventDefault();
setFilter('all');
}}
>
All
</a>

<a
href="#/active"
className={`filter__link ${filter === 'active' ? 'selected' : ''}`}
data-cy="FilterLinkActive"
onClick={event => {
event.preventDefault();
setFilter('active');
}}
>
Active
</a>

<a
href="#/completed"
className={`filter__link ${filter === 'completed' ? 'selected' : ''}`}
data-cy="FilterLinkCompleted"
onClick={event => {
event.preventDefault();
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 required parameters and then map through it to create links and avoid code repetition

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
</div>
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

@Kit3AWP Kit3AWP requested a review from etojeDenys June 22, 2026 11:40

@vitalii-bondarenko-ua vitalii-bondarenko-ua 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.

Looks good

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