diff --git a/src/App.js b/src/App.js index 9571c20..74ac680 100644 --- a/src/App.js +++ b/src/App.js @@ -6,7 +6,9 @@ import LoginPage from "./page/LoginPage"; function App() { return (
- + + +
); } diff --git a/src/components/Darkmode/Darkmode.jsx b/src/components/Darkmode/Darkmode.jsx index cdb4e78..02b38cf 100644 --- a/src/components/Darkmode/Darkmode.jsx +++ b/src/components/Darkmode/Darkmode.jsx @@ -1,7 +1,28 @@ import { useState } from "react"; import "./Darkmode.css"; + +{/*
*/} const Darkmode = () => { - return
; + const [isDark,setDark] = useState(false); + + + const changeMod=()=>{ + setDark(!isDark); + }; + + return( +
+

{isDark ? "다크모드" : "라이트모드"}

+ +
+ ); + + + + }; + export default Darkmode; diff --git a/src/components/LoginForm/LoginForm.jsx b/src/components/LoginForm/LoginForm.jsx index 6fa5a06..6dacf42 100644 --- a/src/components/LoginForm/LoginForm.jsx +++ b/src/components/LoginForm/LoginForm.jsx @@ -1,20 +1,44 @@ -import React, { useEffect, useRef, useState } from "react"; +import React, { useState } from "react"; import "./LoginForm.css"; const LoginForm = ({ validUser }) => { - const [userid, setUserid] = useState(""); - const [userpw, setUserpw] = useState(""); + const [id, setId] = useState(""); + const [pw, setPw] = useState(""); const [message, setMessage] = useState(""); - const inputRef = useRef(null); + + const handleSubmit = (e) => { + e.preventDefault(); + if (id === validUser.id && pw === validUser.pw) { + setMessage("로그인 되었습니다!"); + } else { + setMessage("아이디와 비밀번호를 다시 확인해주세요!"); + } + }; return (
- - - +
+
+ setId(e.target.value)} + /> +
+
+ setPw(e.target.value)} + /> +
+ +
{message &&

{message}

}
); }; -export default LoginForm; +export default LoginForm; \ No newline at end of file