From b257b5b48bfec054f2fda34bcff12f2a65091764 Mon Sep 17 00:00:00 2001 From: Yaser Date: Mon, 8 Jul 2024 19:28:59 -0400 Subject: [PATCH] Removed unused dependencies & fixed formatting --- .../src/components/pages/tasks/TaskModal.tsx | 178 +++++++++--------- 1 file changed, 87 insertions(+), 91 deletions(-) diff --git a/frontend/src/components/pages/tasks/TaskModal.tsx b/frontend/src/components/pages/tasks/TaskModal.tsx index 8f2a91e..404f0d8 100644 --- a/frontend/src/components/pages/tasks/TaskModal.tsx +++ b/frontend/src/components/pages/tasks/TaskModal.tsx @@ -7,14 +7,8 @@ import { Flex, FormControl, FormLabel, - InputRightElement, - InputGroup, Checkbox, - Container, } from "@chakra-ui/react"; -import VisibilityIcon from "@mui/icons-material/Visibility"; -import VisibilityOffIcon from "@mui/icons-material/VisibilityOff"; -import { TbTrash } from "react-icons/tb"; import ModalContainer from "../../common/ModalContainer"; import FormField from "../../common/FormField"; @@ -26,18 +20,18 @@ type Props = { const generateOptions = () => { const options = []; - for (let hour = 0; hour < 24; hour+=1) { + for (let hour = 0; hour < 24; hour += 1) { for (let minute = 0; minute < 60; minute += 30) { let formattedHour; if (hour === 0) { formattedHour = "12"; } else if (hour > 12) { formattedHour = `${hour - 12}`; - } else{ + } else { formattedHour = `${hour}`; } - const ampm = hour < 12 ? 'am' : 'pm'; - const formattedMinute = minute.toString().padStart(2, '0'); + const ampm = hour < 12 ? "am" : "pm"; + const formattedMinute = minute.toString().padStart(2, "0"); options.push(`${formattedHour}:${formattedMinute}${ampm}`); } } @@ -67,78 +61,77 @@ const DateInput = ({ setRecurrenceFrequency: React.Dispatch>; submitPressed: boolean; }) => { - return( - - - - Due Date - - - - - setDueDate(e.target.value)} - /> - - at - - - - - setIsAllDay(e.target.checked)} - m={0} - > - All Day - - + return ( + + + + Due Date + + + + setDueDate(e.target.value)} + /> + + at + + + + + setIsAllDay(e.target.checked)} + m={0} + > + All Day + + + - - - -); + + + ); }; const TaskModal = ({ isOpen, setIsOpen }: Props): React.ReactElement => { @@ -148,7 +141,7 @@ const TaskModal = ({ isOpen, setIsOpen }: Props): React.ReactElement => { const [dueTime, setDueTime] = useState(""); const [isAllDay, setIsAllDay] = useState(false); const [recurrenceFrequency, setRecurrenceFrequency] = useState(""); - const [marillacBucks, setMarillacBucks] = useState(''); + const [marillacBucks, setMarillacBucks] = useState(""); const [submitPressed, setSubmitPressed] = useState(false); @@ -173,8 +166,8 @@ const TaskModal = ({ isOpen, setIsOpen }: Props): React.ReactElement => { }; const handleMoneyInput = () => { - const inputValue = marillacBucks.replace(/[^0-9.]/g, ''); // Remove non-numeric and non-period characters - + const inputValue = marillacBucks.replace(/[^0-9.]/g, ""); // Remove non-numeric and non-period characters + if (inputValue) { const numberValue = parseFloat(inputValue).toFixed(2); setMarillacBucks(numberValue); @@ -182,12 +175,15 @@ const TaskModal = ({ isOpen, setIsOpen }: Props): React.ReactElement => { }; // delete task api stuff - const handleDelete = () => { - - } + const handleDelete = () => {}; return ( - + { Cancel