Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature-051,054: Enter 입력이 되면 클릭 이벤트 실행 #110

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/pages/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ const SignInPage: React.FC = () => {
}
};

const handleOnKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Enter') {
handleOnClick(); // Enter 입력이 되면 클릭 이벤트 실행
}
};

const handleOnClick = () => {
handleClickLoginButton();
}

const redirect_uri = `${location.origin}/social-account`; //Redirect URI
const KAKAO_KEY = '77ddf1baeb87f4a9752ed437db43cd96'; //kakao REST API KEY
const NAVER_CLIENT_ID = 'qR4Npp1ui69SCF6nAJd2';
Expand Down Expand Up @@ -181,6 +191,7 @@ const SignInPage: React.FC = () => {
placeholder="비밀번호를 입력해주세요."
name="password"
value={loginInfo.password}
onKeyDown={handleOnKeyDown}
/>

<Button
Expand Down
16 changes: 15 additions & 1 deletion src/pages/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ const SignUp = () => {
}
};

const handleOnKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Enter') {
handleOnClick(); // Enter 입력이 되면 클릭 이벤트 실행
}
};

const handleOnClick = () => {
onApply();
}

return (
<SignupPageStyles.Wrapper>
<SignupPageStyles.LogoSection>
Expand Down Expand Up @@ -296,6 +306,7 @@ const SignUp = () => {
name="passwordCheck"
value={passwordCheck}
onChange={onChangePasswordCheck}
onKeyDown={handleOnKeyDown}
></SignupPageStyles.InputBox>
{(passwordCheck || passwordCheck === '') &&
(mismatchError ? (
Expand All @@ -321,7 +332,10 @@ const SignUp = () => {
isPassword &&
passwordCheck &&
!mismatchError ? (
<SignupPageStyles.SucButton type="submit" onClick={onApply}>
<SignupPageStyles.SucButton
type="submit"
onClick={onApply}
>
가입하기
</SignupPageStyles.SucButton>
) : (
Expand Down
Loading