From 08074003edec68aae047474edf54309318f03c6e Mon Sep 17 00:00:00 2001 From: vanvalera <115824927+vanvalera@users.noreply.github.com> Date: Wed, 2 Oct 2024 22:35:48 +0300 Subject: [PATCH] fix --- README.md | 2 +- src/components/TodoList.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 903c876f9..7982022ec 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,4 @@ Implement a simple [TODO app](https://mate-academy.github.io/react_todo-app/) th - Implement a solution following the [React task guidelines](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline). - Use the [React TypeScript cheat sheet](https://mate-academy.github.io/fe-program/js/extra/react-typescript). - Open another terminal and run tests with `npm test` to ensure your solution is correct. -- Replace `` with your GitHub username in the [DEMO LINK](https://.github.io/react_todo-app/) and add it to the PR description. +- Replace `` with your GitHub username in the [DEMO LINK](https://vanvalera.github.io/react_todo-app/) and add it to the PR description. diff --git a/src/components/TodoList.tsx b/src/components/TodoList.tsx index 5617ccc72..e3dff9e51 100644 --- a/src/components/TodoList.tsx +++ b/src/components/TodoList.tsx @@ -21,8 +21,10 @@ export const TodoList: React.FC = () => { return !todo.completed; case Filter.COMPLETED: return todo.completed; - default: + case Filter.ALL: return true; + default: + return false; } }); @@ -68,7 +70,7 @@ export const TodoList: React.FC = () => { type="checkbox" className="todo__status" checked={todo.completed} - onClick={() => toggleTodoCompleted(todo.id)} + onChange={() => toggleTodoCompleted(todo.id)} />