generated from GroupBy-Side-Project-GSP/Repository_Generator
-
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
1 parent
efdcd34
commit d58f4cf
Showing
4 changed files
with
278 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { AuthContent } from '../../component/Auth/.'; | ||
import styled from 'styled-components'; | ||
import { theme, flexCenter } from '../../style/theme'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
const FindIdandPwpage = () => { | ||
const navigate = useNavigate(); | ||
return ( | ||
<Wrapper> | ||
<AuthContent title="아이디 / 비밀번호 찾기" /> | ||
<div className="info">아이디 / 비밀번호를 찾아보세요</div> | ||
<div className="find-button" onClick={() => navigate(`/find/id`)}> | ||
아이디 찾기 | ||
</div> | ||
<div className="find-button" onClick={() => navigate(`/find/pw`)}> | ||
비밀번호 찾기 | ||
</div> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default FindIdandPwpage; | ||
|
||
const Wrapper = styled.div` | ||
width: 100%; | ||
${flexCenter} | ||
flex-direction: column; | ||
min-height: 100vh; | ||
.info { | ||
${flexCenter} | ||
color: #bdbdbd; | ||
font-size: 2.4rem; | ||
text-align: center; | ||
margin-bottom: 8rem; | ||
} | ||
.find-button { | ||
box-shadow: 1px 1px ${theme.color.light_gray}; | ||
${flexCenter} | ||
width: 58rem; | ||
border: 2px solid ${theme.color.Main}; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
height: 7rem; | ||
margin-bottom: 2rem; | ||
font-weight: bold; | ||
background: ${theme.color.white}; | ||
color: ${theme.color.Main}; | ||
font-size: 1.6rem; | ||
&:hover { | ||
background: ${theme.color.Main}; | ||
color: white; | ||
} | ||
} | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import styled from 'styled-components'; | ||
import { useForm } from 'react-hook-form'; | ||
import { AuthContent, LoginButton } from '../../component/Auth/.'; | ||
import { theme, flexCenter, inputlabel, inputForm } from '../../style/theme'; | ||
|
||
const FindIdpage = () => { | ||
interface Form { | ||
email: string; | ||
company_name: string; | ||
} | ||
const initValue: Form = { | ||
email: '', | ||
company_name: '', | ||
}; | ||
const { | ||
handleSubmit, | ||
register, | ||
formState: { errors }, | ||
} = useForm<Form>({ | ||
mode: 'onSubmit', | ||
defaultValues: initValue, | ||
}); | ||
|
||
const onSubmit = (data: Form) => { | ||
console.log(data); | ||
}; | ||
return ( | ||
<Wrapper> | ||
<AuthContent title="아이디 찾기" /> | ||
<form onSubmit={handleSubmit(onSubmit)}> | ||
<InputWrapper> | ||
<div className="label">대표 이메일</div> | ||
<Input | ||
placeholder="[email protected]" | ||
{...register('email', { | ||
required: '대표 이메일을 입력해주세요.', | ||
pattern: { | ||
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, | ||
message: '이메일을 형식에 맞게 작성해주세요', | ||
}, | ||
})} | ||
/> | ||
<button className="email-auth">인증</button> | ||
{errors.email && ( | ||
<SubmitMessage>{errors.email.message}</SubmitMessage> | ||
)} | ||
</InputWrapper> | ||
<InputWrapper> | ||
<div className="label">기업명</div> | ||
<Input | ||
placeholder="기업명" | ||
{...register('company_name', { | ||
required: '기업명을 입력해주세요.', | ||
pattern: { | ||
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, | ||
message: '기업명을 형식에 맞게 작성해주세요', | ||
}, | ||
})} | ||
/> | ||
{errors.company_name && ( | ||
<SubmitMessage>{errors.company_name.message}</SubmitMessage> | ||
)} | ||
</InputWrapper> | ||
<LoginButton | ||
value="확인" | ||
isDisabled={!errors.company_name && !errors.email ? false : true} | ||
/> | ||
</form> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default FindIdpage; | ||
|
||
const SubmitMessage = styled.div` | ||
font-size: 1.2rem; | ||
height: 2rem; | ||
color: #ff1717; | ||
`; | ||
|
||
const Wrapper = styled.div` | ||
${flexCenter} | ||
width: 100%; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
& + & { | ||
margin-bottom: 5rem; | ||
} | ||
`; | ||
|
||
const InputWrapper = styled.div` | ||
position: relative; | ||
.label { | ||
${inputlabel} | ||
} | ||
.email-auth { | ||
position: absolute; | ||
right: 0; | ||
width: 7rem; | ||
height: 3.4rem; | ||
color: ${theme.color.Main}; | ||
border-radius: 7px; | ||
border: 2px solid ${theme.color.Main}; | ||
} | ||
& + & { | ||
margin-top: 1rem; | ||
} | ||
`; | ||
|
||
const Input = styled.input` | ||
${inputForm} | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import { useForm } from 'react-hook-form'; | ||
import { AuthContent, LoginButton } from '../../component/Auth/.'; | ||
import styled from 'styled-components'; | ||
import { theme, flexCenter, inputlabel, inputForm } from '../../style/theme'; | ||
|
||
const FindIdpage = () => { | ||
interface Form { | ||
email: string; | ||
id: string; | ||
} | ||
const initValue: Form = { | ||
email: '', | ||
id: '', | ||
}; | ||
const { | ||
handleSubmit, | ||
register, | ||
formState: { errors }, | ||
} = useForm<Form>({ | ||
mode: 'onSubmit', | ||
defaultValues: initValue, | ||
}); | ||
|
||
const onSubmit = (data: Form) => { | ||
console.log(data); | ||
}; | ||
return ( | ||
<Wrapper> | ||
<AuthContent title="비밀번호 찾기" /> | ||
<form onSubmit={handleSubmit(onSubmit)}> | ||
<InputWrapper> | ||
<div className="label">대표 이메일</div> | ||
<Input | ||
placeholder="[email protected]" | ||
{...register('email', { | ||
required: '대표 이메일을 입력해주세요.', | ||
pattern: { | ||
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, | ||
message: '이메일을 형식에 맞게 작성해주세요', | ||
}, | ||
})} | ||
/> | ||
<button className="email-auth">인증</button> | ||
{errors.email && ( | ||
<SubmitMessage>{errors.email.message}</SubmitMessage> | ||
)} | ||
</InputWrapper> | ||
<InputWrapper> | ||
<div className="label">아이디</div> | ||
<Input | ||
placeholder="아이디" | ||
{...register('id', { | ||
required: '아이디를 입력해주세요.', | ||
pattern: { | ||
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i, | ||
message: '아이디를 형식에 맞게 작성해주세요', | ||
}, | ||
})} | ||
/> | ||
{errors.id && <SubmitMessage>{errors.id.message}</SubmitMessage>} | ||
</InputWrapper> | ||
<LoginButton | ||
value="확인" | ||
isDisabled={!errors.id && !errors.email ? false : true} | ||
/> | ||
</form> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default FindIdpage; | ||
|
||
const SubmitMessage = styled.div` | ||
font-size: 1.2rem; | ||
height: 2rem; | ||
color: #ff1717; | ||
`; | ||
|
||
const Wrapper = styled.div` | ||
${flexCenter} | ||
width: 100%; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
& + & { | ||
margin-bottom: 5rem; | ||
} | ||
`; | ||
|
||
const InputWrapper = styled.div` | ||
position: relative; | ||
.label { | ||
${inputlabel} | ||
} | ||
.email-auth { | ||
position: absolute; | ||
right: 0; | ||
width: 7rem; | ||
height: 3.4rem; | ||
color: ${theme.color.Main}; | ||
border-radius: 7px; | ||
border: 2px solid ${theme.color.Main}; | ||
} | ||
& + & { | ||
margin-top: 1rem; | ||
} | ||
`; | ||
|
||
const Input = styled.input` | ||
${inputForm} | ||
`; |