Skip to content

add task P1#2403

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

add task P1#2403
ArtemNosachenko wants to merge 3 commits into
mate-academy:masterfrom
ArtemNosachenko:develop

Conversation

@ArtemNosachenko

Copy link
Copy Markdown

@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/App.tsx Outdated
export const App: React.FC = () => {
const [todos, setTodos] = React.useState<Todo[]>([]);
const [errorMessage, setErrorMessage] = React.useState('');
const [filter, setFilter] = React.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.

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

Comment thread src/App.tsx Outdated
const activeTodos = todos.filter(todo => !todo.completed);
const visibleTodos = todos.filter(todo => {
switch (filter) {
case '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' into a separate enum and use it here

Comment thread src/App.tsx Outdated
case 'active':
return !todo.completed;

case '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' into a separate enum and use it here

Comment thread src/App.tsx Outdated
<div
key={todo.id}
data-cy="Todo"
className={todo.completed ? 'todo completed' : '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 use classNames here

Comment thread src/App.tsx Outdated
<a
href="#/"
data-cy="FilterLinkAll"
className={

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
className={
filter === 'active' ? 'filter__link selected' : 'filter__link'
}
onClick={() => setFilter('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' into a separate enum and use it here

Comment thread src/App.tsx Outdated
className={
filter === 'all' ? 'filter__link selected' : 'filter__link'
}
onClick={() => setFilter('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' into a separate enum and use it here

Comment thread src/App.tsx Outdated
? 'filter__link selected'
: 'filter__link'
}
onClick={() => setFilter('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' into a separate enum and use it here

Comment thread src/App.tsx Outdated
<a
href="#/completed"
data-cy="FilterLinkCompleted"
className={

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 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 ${

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 use classNames here

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

Try to pass all tests.
Image

I think it can be caused because this caret is selected by default
Image

@ArtemNosachenko

Copy link
Copy Markdown
Author

Can I copy the all SRC folder into next part?

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

Can I copy the all SRC folder into next part?

not a whole src/ folder, but several components - in the next chap there should be some new functional, so be careful

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