Skip to content

Commit

Permalink
center "clear completed" btn
Browse files Browse the repository at this point in the history
  • Loading branch information
deandre25 committed Sep 19, 2023
1 parent bd4ddcd commit b27c62a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/components/TodoFooter/TodoFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const TodoFooter: React.FC<Props> = ({
)}
</span>

{/* Active filter should have a 'selected' class */}
<nav className="filter">
<a
href="#/"
Expand Down Expand Up @@ -64,15 +63,15 @@ export const TodoFooter: React.FC<Props> = ({
</a>
</nav>

{todosCompleted && (
<button
type="button"
className="todoapp__clear-completed"
onClick={deleteCompletedTodo}
>
Clear completed
</button>
)}
<button
type="button"
className={classNames('todoapp__clear-completed', {
hidden: !todosCompleted,
})}
onClick={deleteCompletedTodo}
>
Clear completed
</button>
</footer>
);
};
5 changes: 5 additions & 0 deletions src/styles/filter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
}
}
}

.hidden {
visibility: hidden;
opacity: 0;
}

0 comments on commit b27c62a

Please sign in to comment.