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

task solution_v1 #1530

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

task solution_v1 #1530

wants to merge 7 commits into from

Conversation

inesshtepa
Copy link

@inesshtepa inesshtepa closed this Dec 3, 2024
@inesshtepa inesshtepa reopened this Dec 3, 2024
@inesshtepa
Copy link
Author

All tests closed locally, but GitHub shows problems with lint and tests...

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, The problem with the tests arises because when we edit here, 2 requests are sent to you, but there should only be 1.
image

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!

src/App.tsx Outdated
Comment on lines 230 to 260
{todos.length !== 0 && (
<footer className="todoapp__footer" data-cy="Footer">
<span className="todo-count" data-cy="TodosCounter">
{`${activeTodos} items left`}
</span>

<nav className="filter" data-cy="Filter">
{Object.values(FilterOptions).map(option => (
<a
key={option}
href={`#/${option}`}
className={classNames('filter__link', {
selected: currentFilter === option,
})}
data-cy={`FilterLink${option}`}
onClick={() => setCurrentFilter(option)}
>
{option}
</a>
))}
</nav>

<button
type="button"
className="todoapp__clear-completed"
data-cy="ClearCompletedButton"
onClick={() => handleClearCompleted()}
disabled={todos.every(todo => !todo.completed) || loading}
>
Clear completed
</button>

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 Footer component

data-cy="statusSelect"
onChange={element => setFilter(element.target.value)}
>
<option value={FilterOptions.All}>All</option>

Choose a reason for hiding this comment

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

Also use enum here

Suggested change
<option value={FilterOptions.All}>All</option>
<option value={FilterOptions.All}>{FilterOptions.All}</option>

@inesshtepa
Copy link
Author

Finally, I found my mistake with double rendering!!

Copy link

@VitaliyBondarenko1982 VitaliyBondarenko1982 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.

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