-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] QFEED-140 회원가입, 아이디찾기, 비밀번호 찾기 api 연동 (#75)
* fix: qfeed-140 회원가입 오류 수정 - 비밀번호 포맷 확인 추가 * feat: qfeed-140 아이디찾기, 비밀번호 인증 페이지 구현 * feat: qfeed-140 비밀번호 재설정
- Loading branch information
1 parent
63037bf
commit f6ddb61
Showing
19 changed files
with
391 additions
and
69 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,41 @@ | ||
import { | ||
StyledFormControl, | ||
StyledFormErrorMessage, | ||
StyledInput, | ||
} from '@/pages/Login/components/LoginForm/LoginForm.styles'; | ||
import { VerificationWrapper } from '@/pages/Register/components/ConfirmForm/ConfirmForm.styles'; | ||
import { FormValues } from '@/pages/Register/type/formType'; | ||
import theme from '@/styles/theme'; | ||
import { FormLabel } from '@chakra-ui/react'; | ||
import { UseFormRegister, FieldErrors } from 'react-hook-form'; | ||
|
||
type EmailFormProps = { | ||
register: UseFormRegister<FormValues>; | ||
errors: FieldErrors<FormValues>; | ||
}; | ||
|
||
export const InputForm = ({ register, errors }: EmailFormProps) => { | ||
return ( | ||
<StyledFormControl isInvalid={!!errors.email}> | ||
<FormLabel>이메일</FormLabel> | ||
<VerificationWrapper> | ||
<StyledInput | ||
borderColor={theme.colors.primary} | ||
focusBorderColor={theme.colors.primary} | ||
color={theme.colors.gray[300]} | ||
background={theme.colors.white} | ||
placeholder="이메일을 입력해주세요." | ||
{...register('email', { | ||
required: '이메일을 입력해주세요', | ||
pattern: { | ||
value: /\S+@\S+\.\S+/, | ||
message: '올바른 이메일 형식이 아닙니다', | ||
}, | ||
})} | ||
type="email" | ||
/> | ||
</VerificationWrapper> | ||
<StyledFormErrorMessage>{errors.email?.message}</StyledFormErrorMessage> | ||
</StyledFormControl> | ||
); | ||
}; |
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,25 @@ | ||
import { STYLES } from '@/pages/Login/Constants/styles'; | ||
import styled from '@emotion/styled'; | ||
import theme from '@/styles/theme'; | ||
import { FormControl, FormErrorMessage, Input } from '@chakra-ui/react'; | ||
|
||
export const StyledInput = styled(Input)` | ||
width: 100%; | ||
max-width: ${STYLES.INPUT.MAX_WIDTH}; | ||
min-height: ${STYLES.INPUT.MIN_HEIGHT}; | ||
border-radius: ${STYLES.BUTTONLOGINFORM.BORDER_RADIUS}; | ||
color: ${theme.colors.gray[300]}; | ||
background: ${theme.colors.white}; | ||
padding: 0 ${STYLES.INPUT.PADDING}; | ||
`; | ||
|
||
export const StyledFormControl = styled(FormControl)` | ||
height: ${STYLES.FORM.CONTROL_HEIGHT}; | ||
position: relative; | ||
margin-bottom: ${STYLES.FORM.MARGIN_BOTTOM}; | ||
`; | ||
|
||
export const StyledFormErrorMessage = styled(FormErrorMessage)` | ||
position: absolute; | ||
bottom: 0; | ||
`; |
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,7 @@ | ||
import styled from '@emotion/styled'; | ||
export const ErrorMessage = styled.p` | ||
size: 0.875rem; | ||
color: red; | ||
text-align: center; | ||
width: 100%; | ||
`; |
41 changes: 41 additions & 0 deletions
41
src/pages/PasswordRecovery/components/EmailForm/EmailForm.tsx
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,41 @@ | ||
import { | ||
StyledFormControl, | ||
StyledFormErrorMessage, | ||
StyledInput, | ||
} from '@/pages/Login/components/LoginForm/LoginForm.styles'; | ||
import { VerificationWrapper } from '@/pages/Register/components/ConfirmForm/ConfirmForm.styles'; | ||
import { FormValues } from '@/pages/Register/type/formType'; | ||
import theme from '@/styles/theme'; | ||
import { FormLabel } from '@chakra-ui/react'; | ||
import { UseFormRegister, FieldErrors } from 'react-hook-form'; | ||
|
||
type EmailFormProps = { | ||
register: UseFormRegister<FormValues>; | ||
errors: FieldErrors<FormValues>; | ||
}; | ||
|
||
export const EmailForm = ({ register, errors }: EmailFormProps) => { | ||
return ( | ||
<StyledFormControl isInvalid={!!errors.email}> | ||
<FormLabel>이메일</FormLabel> | ||
<VerificationWrapper> | ||
<StyledInput | ||
borderColor={theme.colors.primary} | ||
focusBorderColor={theme.colors.primary} | ||
color={theme.colors.gray[300]} | ||
background={theme.colors.white} | ||
placeholder="이메일을 입력해주세요." | ||
{...register('email', { | ||
required: '이메일을 입력해주세요', | ||
pattern: { | ||
value: /\S+@\S+\.\S+/, | ||
message: '올바른 이메일 형식이 아닙니다', | ||
}, | ||
})} | ||
type="email" | ||
/> | ||
</VerificationWrapper> | ||
<StyledFormErrorMessage>{errors.email?.message}</StyledFormErrorMessage> | ||
</StyledFormControl> | ||
); | ||
}; |
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
Oops, something went wrong.