diff --git a/App.css b/App.css new file mode 100644 index 00000000..eaea2a49 --- /dev/null +++ b/App.css @@ -0,0 +1,14 @@ +.App { + width: 500px; + margin:0 auto; + display: flex; + flex-direction: column; + gap: 20px; +} + +.checkbtn{ + width: 120px; + height: 40px; + border-radius: 5px; + border: 10px; +} \ No newline at end of file diff --git a/App.jsx b/App.jsx new file mode 100644 index 00000000..4d84a64f --- /dev/null +++ b/App.jsx @@ -0,0 +1,58 @@ +import React, {useCallback, useState} from "react" +import "./App.css" +import Header from "./src/component/Header" +import List from "./src/component/List" +import Todomaker from "./src/component/Todomaker" +import ReactDOM from "react-dom/client"; +function App(){ + + + + const [TodoList, setTodoList] = useState([]) + const [checkTodoList, setCheckTodoList] = useState([]) + const [showChecked, setShowChecked] = useState(false) + + const onRemove = (id) => { + setTodoList(TodoList.filter((todo) => todo.id !== id)) + setCheckTodoList(checkTodoList.filter((todo) => todo.id !== id)); + } + + const checkPush = (id, content) => { + const newcheck = { + id : id, + isDone : true, + content : content + + } + setCheckTodoList([...checkTodoList, newcheck]) + } + const toggleCheckedList = () => { + setShowChecked(!showChecked); // 버튼 클릭 이벤트 핸들링 함수 + }; + + const addNewTodo = (content)=> { + const newTodo = { + id:TodoList.length, + isDone : false, + content : content + }; + setTodoList([...TodoList, newTodo]) + } + return ( +