diff --git a/frontend/public/assets/img/edit.png b/frontend/public/assets/img/edit.png new file mode 100644 index 0000000..639f11c Binary files /dev/null and b/frontend/public/assets/img/edit.png differ diff --git a/frontend/src/components/TaskModal.jsx b/frontend/src/components/TaskModal.jsx new file mode 100644 index 0000000..b3a3b6b --- /dev/null +++ b/frontend/src/components/TaskModal.jsx @@ -0,0 +1,62 @@ +import { useState } from "react"; +import styles from "../pages/admin/ManageTask.module.css"; + +const TaskModal = ({ weekInfo, onClose }) => { + const [topic, setTopic] = useState(""); + const [day, setDay] = useState(""); + const [taskList, setTaskList] = useState([""]); + + const handleTaskChange = (index, value) => { + const newTasks = [...taskList]; + newTasks[index] = value; + setTaskList(newTasks); + }; + + const handleAddTask = () => { + setTaskList([...taskList, ""]); + }; + + return ( +
+
+
+

{weekInfo.week}

+ +
+
+ + setTopic(e.target.value)} + /> + + setDay(e.target.value)} + /> + + {taskList.map((task, i) => ( + handleTaskChange(i, e.target.value)} + /> + ))} + +
+
+ +
+
+
+ ); +}; + +export default TaskModal; diff --git a/frontend/src/pages/admin/ManageStudent.module.css b/frontend/src/pages/admin/ManageStudent.module.css index 014c39f..931680a 100644 --- a/frontend/src/pages/admin/ManageStudent.module.css +++ b/frontend/src/pages/admin/ManageStudent.module.css @@ -21,11 +21,14 @@ color: white; padding: 15px; border-radius: 8px; - border: 1px solid #39ff14; + border: 1px solid var(--fill-gray); text-align: left; font-size: 16px; width: 100%; } +.student_button:hover { + border: 1px solid #39ff14; +} .pagination { margin-top: 60px; display: flex; diff --git a/frontend/src/pages/admin/ManageTask.jsx b/frontend/src/pages/admin/ManageTask.jsx index 713095d..82075dc 100644 --- a/frontend/src/pages/admin/ManageTask.jsx +++ b/frontend/src/pages/admin/ManageTask.jsx @@ -1,10 +1,51 @@ +import { useState } from "react"; import Header from "../../components/Header"; import style from "./ManageTask.module.css"; +import TaskModal from "../../components/TaskModal"; + +const weekData = [ + { week: "1주차", title: "Comming soon~", tasks: [] }, + { week: "2주차", title: "Comming soon~", tasks: [] }, + { week: "3주차", title: "Comming soon~", tasks: [] }, + { week: "4주차", title: "Comming soon~", tasks: [] }, + { week: "5주차", title: "Comming soon~", tasks: [] }, +]; const ManageTask = () => { + const [selectedWeekIndex, setSelectedWeekIndex] = useState(null); + const [showModal, setShowModal] = useState(false); + + const handleEditClick = (index) => { + setSelectedWeekIndex(index); + setShowModal(true); + }; + + const closeModal = () => setShowModal(false); + return (
+
+ {weekData.map((week, index) => ( +
+ + edit handleEditClick(index)} + /> +
+ ))} +
+ {showModal && ( + + )}
); }; diff --git a/frontend/src/pages/admin/ManageTask.module.css b/frontend/src/pages/admin/ManageTask.module.css index 9099a04..36906ff 100644 --- a/frontend/src/pages/admin/ManageTask.module.css +++ b/frontend/src/pages/admin/ManageTask.module.css @@ -4,3 +4,103 @@ flex-direction: column; align-items: center; } +.week_container { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; +} +.week_block { + display: flex; + align-items: center; + margin: 10px 0; + width: 100%; + justify-content: center; +} +.week_button { + background-color: #444; + color: white; + padding: 14px 16px; + border: none; + border-radius: 8px; + min-width: 250px; + margin-right: 8px; + font-size: 16px; + display: flex; + justify-content: flex-start; +} +.edit_icon { + width: 20px; + height: 20px; + cursor: pointer; +} +.modal_overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.6); + display: flex; + justify-content: center; + align-items: center; +} +.modal { + background-color: #333; + border: 1px solid #4fff24; + border-radius: 12px; + padding: 20px; + width: 300px; + color: white; + display: flex; + flex-direction: column; + gap: 10px; + align-items: center; +} +.modal_header { + display: flex; + justify-content: space-between; + align-items: center; + position: relative; +} +.close_button { + background: none; + border: none; + color: white; + font-size: 20px; + cursor: pointer; + position: absolute; + left: 130px; +} +.modal_body { + width: 90%; +} +.modal_body label { + margin-block: 10px; + display: block; +} +.modal_body input { + width: 100%; + padding: 6px; + margin-bottom: 8px; + background-color: #555; + border: none; + border-radius: 4px; + color: white; +} +.add_button { + background: none; + border: none; + font-size: 24px; + color: white; + cursor: pointer; +} +.save_button { + margin-top: 10px; + padding: 8px 16px; + background-color: #666; + border: none; + border-radius: 6px; + color: white; + cursor: not-allowed; +}