Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #1053

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

solution #1053

wants to merge 5 commits into from

Conversation

yaros-dev
Copy link

Copy link

@TarasHoliuk TarasHoliuk left a comment

Choose a reason for hiding this comment

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

Well done! A few small comments


export const TodoList: React.FC = () => {
return (
<>
<p className="notification is-warning">

Choose a reason for hiding this comment

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

You should show it if there are no filtered todos:

image

Working version example:
image

Comment on lines 34 to 35
{filteredTodos.map(todo => {
return (

Choose a reason for hiding this comment

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

Suggested change
{filteredTodos.map(todo => {
return (
{filteredTodos.map(todo => {
const { completed, id, title } = todo;
return (

Comment on lines 54 to 55
'has-text-danger': todo.completed === false,
'has-text-success': todo.completed === true,

Choose a reason for hiding this comment

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

Suggested change
'has-text-danger': todo.completed === false,
'has-text-success': todo.completed === true,
'has-text-danger': !todo.completed,
'has-text-success': todo.completed,

package.json Outdated
"@mate-academy/students-ts-config": "*",
"@mate-academy/stylelint-config": "*",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-redux": "^7.1.33",
"@types/react-transition-group": "^4.4.10",
"@typescript-eslint/eslint-plugin": "^8.8.0",

Choose a reason for hiding this comment

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

Do you really need it?
image

I guess locally you did npm I --legacy-per-deps to fix it. But not sure you need this version. If yes - you can try to change "@typescript-eslint/parser": "^7.16.0" version to the same (see error)

Copy link
Author

Choose a reason for hiding this comment

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

My solution was to clone the repo into a new folder and reinstall the dependencies. Thanks!

Copy link

@volodymyr-soltys97 volodymyr-soltys97 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 on lines 41 to 66
const { completed, id, title } = todo;

return (
<tr
data-cy="todo"
className={classnames({
'has-background-info-light': selectedTodo,
})}
key={id}
>
<td className="is-vcentered">{id}</td>
<td className="is-vcentered">
{completed && (
<span className="icon" data-cy="iconCompleted">
<i className="fas fa-check" />
</span>
)}
</td>
<td className="is-vcentered is-expanded">
<p
className={classnames({
'has-text-danger': !completed,
'has-text-success': completed,
})}
>
{title}

Choose a reason for hiding this comment

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

Move this logic to the TodoItem component

Comment on lines 12 to 16
case 'active':
filteredTodos = todos.filter(todo => !todo.completed);
break;

case 'completed':

Choose a reason for hiding this comment

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

Create a enum for 'all', 'active', 'completed' and use it everywhere

Copy link

@volodymyr-soltys97 volodymyr-soltys97 left a comment

Choose a reason for hiding this comment

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

Great work! 🔥

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