Skip to content

Commit

Permalink
Merge pull request #110 from teamViNO/feature-006
Browse files Browse the repository at this point in the history
feature-051,054: Enter 입력이 되면 클릭 이벤트 실행
  • Loading branch information
whistleJs authored Feb 19, 2024
2 parents 13d4780 + c9630ea commit ab0cbd1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
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

0 comments on commit ab0cbd1

Please sign in to comment.