Commit 3611461a authored by Kim, Chaerin's avatar Kim, Chaerin
Browse files

disabled 수정

parent 655aefd3
...@@ -13,17 +13,19 @@ const INIT_USER = { ...@@ -13,17 +13,19 @@ const INIT_USER = {
const Signup = () => { const Signup = () => {
const [user, setUser] = useState(INIT_USER); const [user, setUser] = useState(INIT_USER);
const [error, setError] = useState(""); const [error, setError] = useState("");
const [disabled, setDisabled] = useState(false);
const [success, setSuccess] = useState(false); const [success, setSuccess] = useState(false);
let disabled = false;
useEffect(() => { useEffect(() => {
disabled = !( setDisabled(
!(
user.name && user.name &&
user.idNumber1 && user.idNumber1 &&
user.idNumber2 && user.idNumber2 &&
user.id && user.id &&
user.password && user.password &&
user.checkpw user.checkpw
)
); );
}, [user]); }, [user]);
...@@ -153,6 +155,7 @@ const Signup = () => { ...@@ -153,6 +155,7 @@ const Signup = () => {
/> />
</div> </div>
</div> </div>
{console.log(disabled)}
<div className="modal-footer"> <div className="modal-footer">
<button type="submit" className="btn btn-primary" disabled={disabled}> <button type="submit" className="btn btn-primary" disabled={disabled}>
회원가입 회원가입
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment