Skip to content

Commit

Permalink
toggel Input button
Browse files Browse the repository at this point in the history
  • Loading branch information
HaniaNassalska committed Sep 22, 2023
1 parent 161b43e commit ba3fdf1
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ export const Input = () => {
setNewTodoName,
allTodosAreActive,
toggleActiveTodo,
todos,
} = useTodo();

return (
<header className="todoapp__header">
<button
type="button"
className={allTodosAreActive
? 'todoapp__toggle-all active' : 'todoapp__toggle-all'}
onClick={() => toggleActiveTodo()}
/>

{todos.length !== 0
&& (
<button
type="button"
className={allTodosAreActive
? 'todoapp__toggle-all active' : 'todoapp__toggle-all'}
onClick={() => toggleActiveTodo()}
/>
)}
<form onSubmit={addNewTodo}>
<input
type="text"
Expand Down

0 comments on commit ba3fdf1

Please sign in to comment.