From 335543d369de2190a8a0591553117ea525ba1380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Wed, 17 May 2023 21:38:31 -0600 Subject: Moved `ToDo.jsx` file into main folder. --- src/ToDo-UI/ToDo.jsx | 239 --------------------------------------------------- 1 file changed, 239 deletions(-) delete mode 100644 src/ToDo-UI/ToDo.jsx (limited to 'src/ToDo-UI') diff --git a/src/ToDo-UI/ToDo.jsx b/src/ToDo-UI/ToDo.jsx deleted file mode 100644 index ceaed49..0000000 --- a/src/ToDo-UI/ToDo.jsx +++ /dev/null @@ -1,239 +0,0 @@ -import React, { useState } from "react"; -import { useSelector, useDispatch } from "react-redux"; -import { add_todo, select_todos } from "../features/todo/reducer"; - -export function NewToDo() { - const my_todos = useSelector(select_todos); - - const dispatch = useDispatch(); - const [new_text, set_new_text] = useState(""); - const [new_done, set_new_done] = useState(false); - const [new_priority, set_new_priority] = useState("Low"); - - function handle_exit_modal() { - // https://stackoverflow.com/questions/27826381/clearing-form-input-fields-in-bootstrap - $("form").get(0).reset(); // Reset form - - set_new_text(""); - set_new_done(false); - set_new_priority("Low"); - } - - return ( - <> -
- -
- - - - ); -} - -export function ListToDos() { - const my_todos = useSelector(select_todos); - - return ( -
- - - - - - - - - - - - {my_todos.map((item) => ( - - - - - - - - ))} - -
#NamePriorityDue DateActions
-
- -
-
{item.text}{item.priority}{item.due_date} -
- - -
-
-
- ); -} -- cgit v1.2.3