diff options
author | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-19 20:52:06 -0600 |
---|---|---|
committer | Adrián Oliva <adrian.oliva@cimat.mx> | 2023-05-19 20:52:06 -0600 |
commit | ebb75b93e85416de5c760fe7ba39f14d92c9e732 (patch) | |
tree | 9440f9c520354852f76f4554461f7078ae97f69e /src/ToDo.jsx | |
parent | 0e96c6939e84ed283ba7229ee9cf8144025c5718 (diff) | |
download | ToDo-App-FE-ebb75b93e85416de5c760fe7ba39f14d92c9e732.tar.gz ToDo-App-FE-ebb75b93e85416de5c760fe7ba39f14d92c9e732.zip |
Finished details on sorting.
Now it sorts after events like "adding new to do" and "edit a to do."
Diffstat (limited to 'src/ToDo.jsx')
-rw-r--r-- | src/ToDo.jsx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/ToDo.jsx b/src/ToDo.jsx index 1f290ab..79d6903 100644 --- a/src/ToDo.jsx +++ b/src/ToDo.jsx @@ -5,6 +5,7 @@ import { change_done, remove_todo, edit_todo, + set_sort_todo, sort_todo, select_todos, select_last_index, @@ -168,7 +169,8 @@ export function NewToDo() { new Date().toString(), }) ), - handle_exit_modal(); + dispatch(sort_todo()); + handle_exit_modal(); }} data-bs-dismiss="modal" > @@ -245,23 +247,27 @@ export function ListToDos() { <th scope="col">Name</th> <th scope="col" - onClick={(e) => + onClick={(e) => { dispatch( - sort_todo({ + set_sort_todo({ where_clicked: "priority", }) - ) - } + ), + dispatch(sort_todo()); + }} > {sort_table_header("Priority", my_sorting)} </th> <th scope="col" - onClick={(e) => + onClick={(e) => { dispatch( - sort_todo({ where_clicked: "due_date" }) - ) - } + set_sort_todo({ + where_clicked: "due_date", + }) + ), + dispatch(sort_todo()); + }} > {sort_table_header("Due Date", my_sorting)} </th> @@ -454,6 +460,7 @@ export function ListToDos() { priority: edit_priority, }) ), + dispatch(sort_todo()), handle_exit_modal(); }} data-bs-dismiss="modal" |