-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
50 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,40 @@ | ||
// "use client"; | ||
"use client"; | ||
|
||
// import React from "react"; | ||
// import * as Styled from "./Form.styled"; | ||
// import Id from "./Id"; | ||
// import Password from "./Password"; | ||
// import Helper from "./Helper"; | ||
// import InvalidMessage from "../../InvalidMessage"; | ||
// import { createUserInfo } from "@/lib/action"; | ||
import React from "react"; | ||
import * as Styled from "./Form.styled"; | ||
import LoginInput from "./LoginInput"; | ||
import LoginButton from "./LoginButton"; | ||
|
||
// function Form() { | ||
// const [id, setId] = React.useState(""); | ||
// const [password, setPassword] = React.useState(""); | ||
// const [isIdValid, setIsIdValid] = React.useState({ | ||
// id: true, | ||
// password: true, | ||
// }); | ||
function Form() { | ||
const [id, setId] = React.useState(""); | ||
const [password, setPassword] = React.useState(""); | ||
const [isIdValid, setIsIdValid] = React.useState({ | ||
id: true, | ||
password: true, | ||
}); | ||
|
||
// return ( | ||
// <form | ||
// method="post" | ||
// action={"/login"} | ||
// onSubmit={(e) => { | ||
// e.preventDefault(); | ||
// const formData = new FormData(e.currentTarget); | ||
// createUserInfo(formData); | ||
// }} | ||
// > | ||
// <Styled.InputGroup> | ||
// <Id setId={setId} /> | ||
// <Password setPassword={setPassword} /> | ||
// </Styled.InputGroup> | ||
// <Helper /> | ||
// {isIdValid.id ? null : ( | ||
// <InvalidMessage message={"아이디 입력이 잘못되었습니다."} /> | ||
// )} | ||
// {isIdValid.password ? null : ( | ||
// <InvalidMessage message={"비밀번호 입력이 잘못되었습니다."} /> | ||
// )} | ||
// <Styled.Button | ||
// id={"submit-id-pwd-btn"} | ||
// type="submit" | ||
// onClick={() => { | ||
// if (id.length >= 6 && id.length <= 20) { | ||
// setIsIdValid((prev) => ({ ...prev, id: true })); | ||
// } | ||
// if (password.length >= 8) { | ||
// setIsIdValid((prev) => ({ ...prev, password: true })); | ||
// } | ||
const InputProps = { | ||
setId, | ||
setPassword, | ||
isIdValid, | ||
}; | ||
|
||
// if (id.length < 6 || id.length > 20) { | ||
// setIsIdValid((prev) => ({ ...prev, id: false })); | ||
// } else if (password.length < 8) { | ||
// setIsIdValid((prev) => ({ ...prev, password: false })); | ||
// } | ||
// }} | ||
// > | ||
// 로그인 | ||
// </Styled.Button> | ||
// </form> | ||
// ); | ||
// } | ||
const ButtonProps = { | ||
id, | ||
password, | ||
setIsIdValid, | ||
}; | ||
|
||
// export default Form; | ||
return ( | ||
<React.Fragment> | ||
<Styled.MainWrapper> | ||
<LoginInput props={InputProps} /> | ||
</Styled.MainWrapper> | ||
<Styled.FooterWrapper> | ||
<LoginButton props={ButtonProps} /> | ||
</Styled.FooterWrapper> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
export default Form; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters