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

my solution #1052

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

Conversation

viktalfrontend
Copy link

@viktalfrontend viktalfrontend commented Sep 4, 2024

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.

Good job 👍
Let's improve your code
It is a bad practice to write so much code in one place, you need to separate the logic into different components, for example Header, TodoItem, TodoList, Footer

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.

Hi, you need to fix this failed test, if you need help feel free in the fe_chat
image


return (
<header className="todoapp__header">
{todos.length !== 0 && (

Choose a reason for hiding this comment

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

Suggested change
{todos.length !== 0 && (
{!!todos.length && (

<button
type="button"
className={classNames('todoapp__toggle-all', {
active: todos.length > 0 && todos.every(todo => todo.completed),

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 helper variable and use it here

/>
</label>
<span data-cy="TodoTitle" className="todo__title">
{todo.title}

Choose a reason for hiding this comment

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

Use destructuring for todo

@viktalfrontend
Copy link
Author

Copy link

@anastasiiavorobiova anastasiiavorobiova 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! Consider adding an empty array to the ls when the app is loaded to pass the test

@viktalfrontend
Copy link
Author

I am passing the tests locally, I am attaching a screenshot. And also when loading the page in my Ls is empty.
https://snipboard.io/Pr1NQs.jpg
https://snipboard.io/8ADHwQ.jpg

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