From e79a56eb15c9f920b5c4e0f49cae63da2c48ccfe Mon Sep 17 00:00:00 2001 From: Ricardo Campos Date: Tue, 24 Sep 2024 12:07:55 -0300 Subject: [PATCH] chore: delete used files --- client/src/components/Modal.module.css | 27 ------- client/src/components/Modal.tsx | 34 -------- client/src/components/TaskForm.module.css | 37 --------- client/src/components/TaskForm.tsx | 97 ----------------------- client/src/components/TaskList.module.css | 38 --------- client/src/components/TaskList.tsx | 54 ------------- 6 files changed, 287 deletions(-) delete mode 100644 client/src/components/Modal.module.css delete mode 100644 client/src/components/Modal.tsx delete mode 100644 client/src/components/TaskForm.module.css delete mode 100644 client/src/components/TaskForm.tsx delete mode 100644 client/src/components/TaskList.module.css delete mode 100644 client/src/components/TaskList.tsx diff --git a/client/src/components/Modal.module.css b/client/src/components/Modal.module.css deleted file mode 100644 index 43d56bd..0000000 --- a/client/src/components/Modal.module.css +++ /dev/null @@ -1,27 +0,0 @@ -.fade { - width: 100%; - height: 100%; - position: absolute; - background-color: #000; - opacity: 0.3; -} - -.modal { - position: absolute; - top: 10%; - left: 0; - right: 0; - margin: 0 auto; - width: 500px; - height: 400px; - z-index: 1; - background-color: #fff; - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; -} - -.modal h2 { - width: 90%; -} \ No newline at end of file diff --git a/client/src/components/Modal.tsx b/client/src/components/Modal.tsx deleted file mode 100644 index a2d9434..0000000 --- a/client/src/components/Modal.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react'; - -import styles from './Modal.module.css'; - -interface Props { - children: React.ReactNode -} - -const Modal: React.FC<{ children: React.ReactNode }> = ({ children }: Props) => { - const closeModal = (): void => { - const modal = document.querySelector('#modal'); - modal!.classList.add('hide'); - }; - - return ( -
- -
- ); -}; - -export default Modal; diff --git a/client/src/components/TaskForm.module.css b/client/src/components/TaskForm.module.css deleted file mode 100644 index d138e14..0000000 --- a/client/src/components/TaskForm.module.css +++ /dev/null @@ -1,37 +0,0 @@ -.form { - display: flex; - flex-direction: column; - max-width: 400px; - margin: 0 auto; -} - -.form input { - padding: 8px 15px; - margin-bottom: 1.5em; - border-radius: 0; - border: 1px solid #282c34; -} - -.form input[type="submit"] { - background-color: #61dafb; - border: 1px solid #61dafb; - color: #000; - transition: .5s; - cursor: pointer; -} - -.form input[type="submit"]:hover { - background-color: #fff; - border-color: #282c34; -} - -.input_container { - display: flex; - flex-direction: column; - text-align: left; -} - -.input_container label { - font-weight: bold; - margin-bottom: .4em; -} \ No newline at end of file diff --git a/client/src/components/TaskForm.tsx b/client/src/components/TaskForm.tsx deleted file mode 100644 index 6d7534f..0000000 --- a/client/src/components/TaskForm.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import React, { - useState, - ChangeEvent, - FormEvent, - useEffect -} from 'react'; - -// CSS -import styles from './TaskForm.module.css'; - -// Interface -import { ITask } from '../interfaces/Task'; - -interface Props { - btnText: string; - taskList: ITask[]; - setTaskList?: React.Dispatch>; - task?: ITask | null; - handleUpdate?(id: number, title: string, difficulty: number): void; -} - -const TaskForm = ({ - btnText, - taskList, - setTaskList, - task, - handleUpdate -}: Props) => { - const [id, setId] = useState(0); - const [title, setTitle] = useState(''); - const [difficulty, setDifficulty] = useState(0); - - useEffect(() => { - if (task) { - setId(task.id); - setTitle(task.title); - setDifficulty(task.difficulty); - } - }, [task]); - - const addTaskHandler = (e: FormEvent) => { - e.preventDefault(); - - if (handleUpdate) { - handleUpdate(id, title, difficulty); - } else { - const newId: number = Math.floor(Math.random() * 1000); - const newTask: ITask = { - id: newId, - title, - difficulty - }; - - setTaskList!([...taskList, newTask]); - setTitle(''); - setDifficulty(0); - } - }; - - const handleChange = (e: ChangeEvent) => { - if (e.target.name === 'title') { - setTitle(e.target.value); - } else { - setDifficulty(parseInt(e.target.value, 10)); - } - }; - - return ( -
-
- - -
- -
- - -
- - -
- ); -}; - -export default TaskForm; diff --git a/client/src/components/TaskList.module.css b/client/src/components/TaskList.module.css deleted file mode 100644 index b0cca10..0000000 --- a/client/src/components/TaskList.module.css +++ /dev/null @@ -1,38 +0,0 @@ -.task { - display: flex; - justify-content: space-between; - max-width: 400px; - margin: 0 auto; - border-bottom: 1px solid #ccc; - padding: 1em; -} - -.details { - text-align: left; -} - -.details h4 { - font-size: 1.2em; - margin-bottom: 1em; -} - -.actions { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.actions button { - margin-bottom: .5em; - font-size: 1.2em; - cursor: pointer; - background-color: #282c34; - color: #fff; - padding: .4em; - transition: .5s; -} - -.actions button:hover { - color: #61dafb; -} diff --git a/client/src/components/TaskList.tsx b/client/src/components/TaskList.tsx deleted file mode 100644 index b8a409b..0000000 --- a/client/src/components/TaskList.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; - -// Interface -import { ITask } from '../interfaces/Task'; - -// CSS -import styles from './TaskList.module.css'; - -interface Props { - taskList: ITask[]; - handleDelete(id: number): void; - handleEdit(task: ITask): void; -} - -const TaskList = ({ taskList, handleDelete, handleEdit }: Props): JSX.Element => { - if (taskList.length) { - return ( - <> - {taskList.map((task) => ( -
-
-

{task.title}

-

- Difficulty: - {task.difficulty} -

-
- -
- - -
-
- ))} - - ); - } - - return

There's no task records

; -}; - -export default TaskList;