forked from CoolPeace-yanolza/frontend
-
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.
Merge pull request CoolPeace-yanolza#173 from CoolPeace-yanolza/feature/
CoolPeace-yanolza#164 [CoolPeace-yanolza#164] 로그인 페이지 코드 리팩토링 (dev로 반영)
- Loading branch information
Showing
4 changed files
with
20 additions
and
2 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
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 |
---|---|---|
|
@@ -21,13 +21,21 @@ const LoginForm = ({ handleModalOpen }: LoginFormProps) => { | |
const navigate = useNavigate(); | ||
const { state } = useLocation(); | ||
|
||
const methods = useForm({ mode: 'onBlur' }); | ||
const methods = useForm({ | ||
mode: 'onBlur' | ||
}); | ||
const { | ||
setValue, | ||
formState: { errors }, | ||
handleSubmit | ||
} = methods; | ||
const isError = !!errors?.login_id || !!errors?.login_password ? true : false; | ||
|
||
const setDefaultValues = async () => { | ||
setValue('login_id', '[email protected]'); | ||
setValue('login_password', 'test1234!'); | ||
}; | ||
|
||
const movetoSignUp = (event: React.MouseEvent<HTMLButtonElement>) => { | ||
event.preventDefault(); | ||
navigate('/signup'); | ||
|
@@ -110,6 +118,13 @@ const LoginForm = ({ handleModalOpen }: LoginFormProps) => { | |
text="회원가입" | ||
buttonFunc={movetoSignUp} | ||
/> | ||
<AuthButton | ||
buttonType="button" | ||
size="large" | ||
variant="skyblue" | ||
text="게스트 계정으로 둘러보기" | ||
buttonFunc={setDefaultValues} | ||
/> | ||
</Buttons> | ||
</form> | ||
</FormProvider> | ||
|
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