File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import NewTodoForm from "./components/NewTodoForm";
44import TodoTable from "./components/TodoTable" ;
55
66function App ( ) {
7+ const [ showAddTodoForm , setShowAddTodoForm ] = useState ( false ) ;
8+
79 const seededTodos = [
810 { rowNumber : 1 , rowDescription : "Feed puppy" , rowAssigned : "User One" } ,
911 { rowNumber : 2 , rowDescription : "Water plants" , rowAssigned : "User Two" } ,
@@ -40,7 +42,13 @@ function App() {
4042 < div className = "card-header" > Your Todo's</ div >
4143 < div className = "card-body" >
4244 < TodoTable todos = { todos } deleteTodo = { deleteTodo } />
43- < NewTodoForm addTodo = { addTodo } />
45+ < button
46+ onClick = { ( ) => setShowAddTodoForm ( ! showAddTodoForm ) }
47+ className = "btn btn-primary"
48+ >
49+ { showAddTodoForm ? "Close New Todo" : "New Todo" }
50+ </ button >
51+ { showAddTodoForm && < NewTodoForm addTodo = { addTodo } /> }
4452 </ div >
4553 </ div >
4654 </ div >
You can’t perform that action at this time.
0 commit comments