Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Luk2asz committed Sep 3, 2023
1 parent 8720317 commit d8429a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import { deleteTodo } from '../api/todos';
import { SortBy, Todo } from '../types';

type Props = {
Expand All @@ -23,7 +22,7 @@ export const Footer: React.FC<Props> = ({
const deleteCompletedtodo = () => {
try {
todos.forEach(async todo => {
if (todo.completed === true) {
if (todo.completed) {
handleSelectedTodo([...selectedTodo, todo.id]);
}
});
Expand All @@ -32,7 +31,7 @@ export const Footer: React.FC<Props> = ({
}

todos.forEach(todo => {
if (todo.completed === true) {
if (todo.completed) {
handleDeleteTodo(todo.id);
}
});
Expand All @@ -47,7 +46,7 @@ export const Footer: React.FC<Props> = ({
<nav className="filter">
<a
href="#/"
className={sortBy === 'all'
className={sortBy === SortBy.all
? 'filter__link selected'
: 'filter__link'}
onClick={() => handleSetSortBy(SortBy.all)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Todos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const Todos: React.FC<Props> = ({
<input
type="text"
ref={inputRef}
className="todoapp__new-todo"
className="todo__title-field"
value={inputValue}
onChange={(e) => {
setInputValue(e.target.value);
Expand Down

0 comments on commit d8429a7

Please sign in to comment.