From 18c0c131f246491908a2ac11bc35659715fa567e Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 16:01:21 +0900 Subject: [PATCH 1/8] =?UTF-8?q?Rename:=20=EC=9C=A0=EC=A0=80=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=ED=8F=B4=EB=8D=94=EB=AA=85=20?= =?UTF-8?q?=EC=86=8C=EB=AC=B8=EC=9E=90=20->=20=EB=8C=80=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/{user => User1}/ErrorMessage.tsx | 0 src/components/{user => User1}/index.ts | 0 .../{user => User1}/useInputBox/UserEmailInputBox.tsx | 0 src/components/{user => User1}/useInputBox/UserInputBox.tsx | 0 src/components/{user => User1}/useInputBox/UserPwInputBox.tsx | 0 src/components/{user => User1}/useInputBox/ValidifyCheck.tsx | 0 src/pages/login/login.page.tsx | 2 +- src/pages/signup/signup.page.tsx | 2 +- 8 files changed, 2 insertions(+), 2 deletions(-) rename src/components/{user => User1}/ErrorMessage.tsx (100%) rename src/components/{user => User1}/index.ts (100%) rename src/components/{user => User1}/useInputBox/UserEmailInputBox.tsx (100%) rename src/components/{user => User1}/useInputBox/UserInputBox.tsx (100%) rename src/components/{user => User1}/useInputBox/UserPwInputBox.tsx (100%) rename src/components/{user => User1}/useInputBox/ValidifyCheck.tsx (100%) diff --git a/src/components/user/ErrorMessage.tsx b/src/components/User1/ErrorMessage.tsx similarity index 100% rename from src/components/user/ErrorMessage.tsx rename to src/components/User1/ErrorMessage.tsx diff --git a/src/components/user/index.ts b/src/components/User1/index.ts similarity index 100% rename from src/components/user/index.ts rename to src/components/User1/index.ts diff --git a/src/components/user/useInputBox/UserEmailInputBox.tsx b/src/components/User1/useInputBox/UserEmailInputBox.tsx similarity index 100% rename from src/components/user/useInputBox/UserEmailInputBox.tsx rename to src/components/User1/useInputBox/UserEmailInputBox.tsx diff --git a/src/components/user/useInputBox/UserInputBox.tsx b/src/components/User1/useInputBox/UserInputBox.tsx similarity index 100% rename from src/components/user/useInputBox/UserInputBox.tsx rename to src/components/User1/useInputBox/UserInputBox.tsx diff --git a/src/components/user/useInputBox/UserPwInputBox.tsx b/src/components/User1/useInputBox/UserPwInputBox.tsx similarity index 100% rename from src/components/user/useInputBox/UserPwInputBox.tsx rename to src/components/User1/useInputBox/UserPwInputBox.tsx diff --git a/src/components/user/useInputBox/ValidifyCheck.tsx b/src/components/User1/useInputBox/ValidifyCheck.tsx similarity index 100% rename from src/components/user/useInputBox/ValidifyCheck.tsx rename to src/components/User1/useInputBox/ValidifyCheck.tsx diff --git a/src/pages/login/login.page.tsx b/src/pages/login/login.page.tsx index 6a7c45bb..cf28560c 100644 --- a/src/pages/login/login.page.tsx +++ b/src/pages/login/login.page.tsx @@ -3,7 +3,7 @@ import authCient from '@api/authClient'; import SubmitBtn from '@components/common/button/SubmitBtn'; import Back from '@components/common/back/Back'; import { KakaoIcon, LogoIcon } from '@components/common/icons/Icons'; -import { ErrorMessage, UserInputBox } from '@components/user'; +import { ErrorMessage, UserInputBox } from '@components/User1'; import { useNavigate } from 'react-router-dom'; import { SubmitHandler, useForm } from 'react-hook-form'; import { LoginFormVlaue } from '@/@types/auth.types'; diff --git a/src/pages/signup/signup.page.tsx b/src/pages/signup/signup.page.tsx index 9adca927..0df73363 100644 --- a/src/pages/signup/signup.page.tsx +++ b/src/pages/signup/signup.page.tsx @@ -1,4 +1,4 @@ -import { UserEmailInputBox, UserPwInputBox } from '@components/user'; +import { UserEmailInputBox, UserPwInputBox } from '@components/User1'; import { useState } from 'react'; const Signup = () => { From 8285a591cbcee1c4653680d3c8c511973cabe48e Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 16:02:06 +0900 Subject: [PATCH 2/8] =?UTF-8?q?Rename:=20=EC=9C=A0=EC=A0=80=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=ED=8F=B4=EB=8D=94=EB=AA=85=20?= =?UTF-8?q?=EC=86=8C=EB=AC=B8=EC=9E=90=20->=20=EB=8C=80=EB=AC=B8=EC=9E=90?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/{User1 => User}/ErrorMessage.tsx | 0 src/components/{User1 => User}/index.ts | 0 .../{User1 => User}/useInputBox/UserEmailInputBox.tsx | 0 src/components/{User1 => User}/useInputBox/UserInputBox.tsx | 0 src/components/{User1 => User}/useInputBox/UserPwInputBox.tsx | 0 src/components/{User1 => User}/useInputBox/ValidifyCheck.tsx | 0 src/pages/login/login.page.tsx | 2 +- src/pages/signup/signup.page.tsx | 2 +- 8 files changed, 2 insertions(+), 2 deletions(-) rename src/components/{User1 => User}/ErrorMessage.tsx (100%) rename src/components/{User1 => User}/index.ts (100%) rename src/components/{User1 => User}/useInputBox/UserEmailInputBox.tsx (100%) rename src/components/{User1 => User}/useInputBox/UserInputBox.tsx (100%) rename src/components/{User1 => User}/useInputBox/UserPwInputBox.tsx (100%) rename src/components/{User1 => User}/useInputBox/ValidifyCheck.tsx (100%) diff --git a/src/components/User1/ErrorMessage.tsx b/src/components/User/ErrorMessage.tsx similarity index 100% rename from src/components/User1/ErrorMessage.tsx rename to src/components/User/ErrorMessage.tsx diff --git a/src/components/User1/index.ts b/src/components/User/index.ts similarity index 100% rename from src/components/User1/index.ts rename to src/components/User/index.ts diff --git a/src/components/User1/useInputBox/UserEmailInputBox.tsx b/src/components/User/useInputBox/UserEmailInputBox.tsx similarity index 100% rename from src/components/User1/useInputBox/UserEmailInputBox.tsx rename to src/components/User/useInputBox/UserEmailInputBox.tsx diff --git a/src/components/User1/useInputBox/UserInputBox.tsx b/src/components/User/useInputBox/UserInputBox.tsx similarity index 100% rename from src/components/User1/useInputBox/UserInputBox.tsx rename to src/components/User/useInputBox/UserInputBox.tsx diff --git a/src/components/User1/useInputBox/UserPwInputBox.tsx b/src/components/User/useInputBox/UserPwInputBox.tsx similarity index 100% rename from src/components/User1/useInputBox/UserPwInputBox.tsx rename to src/components/User/useInputBox/UserPwInputBox.tsx diff --git a/src/components/User1/useInputBox/ValidifyCheck.tsx b/src/components/User/useInputBox/ValidifyCheck.tsx similarity index 100% rename from src/components/User1/useInputBox/ValidifyCheck.tsx rename to src/components/User/useInputBox/ValidifyCheck.tsx diff --git a/src/pages/login/login.page.tsx b/src/pages/login/login.page.tsx index cf28560c..cd02a568 100644 --- a/src/pages/login/login.page.tsx +++ b/src/pages/login/login.page.tsx @@ -3,7 +3,7 @@ import authCient from '@api/authClient'; import SubmitBtn from '@components/common/button/SubmitBtn'; import Back from '@components/common/back/Back'; import { KakaoIcon, LogoIcon } from '@components/common/icons/Icons'; -import { ErrorMessage, UserInputBox } from '@components/User1'; +import { ErrorMessage, UserInputBox } from '@components/User'; import { useNavigate } from 'react-router-dom'; import { SubmitHandler, useForm } from 'react-hook-form'; import { LoginFormVlaue } from '@/@types/auth.types'; diff --git a/src/pages/signup/signup.page.tsx b/src/pages/signup/signup.page.tsx index 0df73363..912ef4e3 100644 --- a/src/pages/signup/signup.page.tsx +++ b/src/pages/signup/signup.page.tsx @@ -1,4 +1,4 @@ -import { UserEmailInputBox, UserPwInputBox } from '@components/User1'; +import { UserEmailInputBox, UserPwInputBox } from '@components/User'; import { useState } from 'react'; const Signup = () => { From d1a2adcb296d616b10c3d47f3268e98aefad2b0e Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 16:03:00 +0900 Subject: [PATCH 3/8] =?UTF-8?q?Rename:=20UserInputBox=20=ED=8F=B4=EB=8D=94?= =?UTF-8?q?=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../User/{useInputBox => UserInputBox}/UserEmailInputBox.tsx | 0 .../User/{useInputBox => UserInputBox}/UserInputBox.tsx | 0 .../User/{useInputBox => UserInputBox}/UserPwInputBox.tsx | 0 .../User/{useInputBox => UserInputBox}/ValidifyCheck.tsx | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename src/components/User/{useInputBox => UserInputBox}/UserEmailInputBox.tsx (100%) rename src/components/User/{useInputBox => UserInputBox}/UserInputBox.tsx (100%) rename src/components/User/{useInputBox => UserInputBox}/UserPwInputBox.tsx (100%) rename src/components/User/{useInputBox => UserInputBox}/ValidifyCheck.tsx (100%) diff --git a/src/components/User/useInputBox/UserEmailInputBox.tsx b/src/components/User/UserInputBox/UserEmailInputBox.tsx similarity index 100% rename from src/components/User/useInputBox/UserEmailInputBox.tsx rename to src/components/User/UserInputBox/UserEmailInputBox.tsx diff --git a/src/components/User/useInputBox/UserInputBox.tsx b/src/components/User/UserInputBox/UserInputBox.tsx similarity index 100% rename from src/components/User/useInputBox/UserInputBox.tsx rename to src/components/User/UserInputBox/UserInputBox.tsx diff --git a/src/components/User/useInputBox/UserPwInputBox.tsx b/src/components/User/UserInputBox/UserPwInputBox.tsx similarity index 100% rename from src/components/User/useInputBox/UserPwInputBox.tsx rename to src/components/User/UserInputBox/UserPwInputBox.tsx diff --git a/src/components/User/useInputBox/ValidifyCheck.tsx b/src/components/User/UserInputBox/ValidifyCheck.tsx similarity index 100% rename from src/components/User/useInputBox/ValidifyCheck.tsx rename to src/components/User/UserInputBox/ValidifyCheck.tsx From 10930523d6e4e456d29a1cf07d4292057712cad0 Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 16:13:15 +0900 Subject: [PATCH 4/8] =?UTF-8?q?Rename:=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85/=EB=A1=9C=EA=B7=B8=EC=9D=B8=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=EB=AA=85=20user=20->=20auth=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AuthInputBox/AuthEmailInputBox.tsx} | 4 ++-- .../UserInputBox.tsx => Auth/AuthInputBox/AuthInputBox.tsx} | 4 ++-- .../AuthInputBox/AuthPwInputBox.tsx} | 4 ++-- .../UserInputBox => Auth/AuthInputBox}/ValidifyCheck.tsx | 2 +- src/components/{User => Auth}/ErrorMessage.tsx | 0 src/components/Auth/index.ts | 6 ++++++ src/components/User/index.ts | 6 ------ src/pages/login/login.page.tsx | 6 +++--- src/pages/signup/signup.page.tsx | 6 +++--- src/utils/{user => Auth}/validationList.ts | 0 10 files changed, 19 insertions(+), 19 deletions(-) rename src/components/{User/UserInputBox/UserEmailInputBox.tsx => Auth/AuthInputBox/AuthEmailInputBox.tsx} (96%) rename src/components/{User/UserInputBox/UserInputBox.tsx => Auth/AuthInputBox/AuthInputBox.tsx} (97%) rename src/components/{User/UserInputBox/UserPwInputBox.tsx => Auth/AuthInputBox/AuthPwInputBox.tsx} (98%) rename src/components/{User/UserInputBox => Auth/AuthInputBox}/ValidifyCheck.tsx (94%) rename src/components/{User => Auth}/ErrorMessage.tsx (100%) create mode 100644 src/components/Auth/index.ts delete mode 100644 src/components/User/index.ts rename src/utils/{user => Auth}/validationList.ts (100%) diff --git a/src/components/User/UserInputBox/UserEmailInputBox.tsx b/src/components/Auth/AuthInputBox/AuthEmailInputBox.tsx similarity index 96% rename from src/components/User/UserInputBox/UserEmailInputBox.tsx rename to src/components/Auth/AuthInputBox/AuthEmailInputBox.tsx index d34cd1e3..d106be56 100644 --- a/src/components/User/UserInputBox/UserEmailInputBox.tsx +++ b/src/components/Auth/AuthInputBox/AuthEmailInputBox.tsx @@ -1,7 +1,7 @@ import { CloseIcon } from '@components/common/icons/Icons'; import { useState } from 'react'; -const UserEmailInputBox = () => { +const AuthEmailInputBox = () => { const [inputValue, setInputValue] = useState(''); const [isEmailValidated, setIsEmailValidated] = useState(true); @@ -63,4 +63,4 @@ const UserEmailInputBox = () => { ); }; -export default UserEmailInputBox; +export default AuthEmailInputBox; diff --git a/src/components/User/UserInputBox/UserInputBox.tsx b/src/components/Auth/AuthInputBox/AuthInputBox.tsx similarity index 97% rename from src/components/User/UserInputBox/UserInputBox.tsx rename to src/components/Auth/AuthInputBox/AuthInputBox.tsx index a969e1b8..481bc27f 100644 --- a/src/components/User/UserInputBox/UserInputBox.tsx +++ b/src/components/Auth/AuthInputBox/AuthInputBox.tsx @@ -16,7 +16,7 @@ interface Props { // children: React.ReactNode; } -const UserInputBox = ({ +const AuthInputBox = ({ label, id, type = 'text', @@ -68,4 +68,4 @@ const UserInputBox = ({ ); }; -export default UserInputBox; +export default AuthInputBox; diff --git a/src/components/User/UserInputBox/UserPwInputBox.tsx b/src/components/Auth/AuthInputBox/AuthPwInputBox.tsx similarity index 98% rename from src/components/User/UserInputBox/UserPwInputBox.tsx rename to src/components/Auth/AuthInputBox/AuthPwInputBox.tsx index 0abc5a80..f4c83b0d 100644 --- a/src/components/User/UserInputBox/UserPwInputBox.tsx +++ b/src/components/Auth/AuthInputBox/AuthPwInputBox.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { CloseIcon } from '@components/common/icons/Icons'; import ValidifyCheck from './ValidifyCheck'; -const UserPwInputBox = () => { +const AuthPwInputBox = () => { const [inputPwValue, setInputPwValue] = useState(''); const onPwInputChange = (e: React.ChangeEvent) => { @@ -97,4 +97,4 @@ const UserPwInputBox = () => { ); }; -export default UserPwInputBox; +export default AuthPwInputBox; diff --git a/src/components/User/UserInputBox/ValidifyCheck.tsx b/src/components/Auth/AuthInputBox/ValidifyCheck.tsx similarity index 94% rename from src/components/User/UserInputBox/ValidifyCheck.tsx rename to src/components/Auth/AuthInputBox/ValidifyCheck.tsx index 08957916..eaf00fa8 100644 --- a/src/components/User/UserInputBox/ValidifyCheck.tsx +++ b/src/components/Auth/AuthInputBox/ValidifyCheck.tsx @@ -1,5 +1,5 @@ import { CheckIcon } from '@components/common/icons/Icons'; -import validationList from '@utils/user/validationList'; +import validationList from '@utils/Auth/validationList'; import { useEffect, useState } from 'react'; interface Props { diff --git a/src/components/User/ErrorMessage.tsx b/src/components/Auth/ErrorMessage.tsx similarity index 100% rename from src/components/User/ErrorMessage.tsx rename to src/components/Auth/ErrorMessage.tsx diff --git a/src/components/Auth/index.ts b/src/components/Auth/index.ts new file mode 100644 index 00000000..3be1288d --- /dev/null +++ b/src/components/Auth/index.ts @@ -0,0 +1,6 @@ +import AuthInputBox from './AuthInputBox/AuthInputBox'; +import AuthEmailInputBox from './AuthInputBox/AuthEmailInputBox'; +import AuthPwInputBox from './AuthInputBox/AuthPwInputBox'; +import ErrorMessage from './ErrorMessage'; + +export { AuthInputBox, AuthEmailInputBox, AuthPwInputBox, ErrorMessage }; diff --git a/src/components/User/index.ts b/src/components/User/index.ts deleted file mode 100644 index 844de37c..00000000 --- a/src/components/User/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import UserInputBox from './useInputBox/UserInputBox'; -import UserEmailInputBox from './useInputBox/UserEmailInputBox'; -import UserPwInputBox from './useInputBox/UserPwInputBox'; -import ErrorMessage from './ErrorMessage'; - -export { UserInputBox, UserEmailInputBox, UserPwInputBox, ErrorMessage }; diff --git a/src/pages/login/login.page.tsx b/src/pages/login/login.page.tsx index cd02a568..ed4e8b7b 100644 --- a/src/pages/login/login.page.tsx +++ b/src/pages/login/login.page.tsx @@ -3,7 +3,7 @@ import authCient from '@api/authClient'; import SubmitBtn from '@components/common/button/SubmitBtn'; import Back from '@components/common/back/Back'; import { KakaoIcon, LogoIcon } from '@components/common/icons/Icons'; -import { ErrorMessage, UserInputBox } from '@components/User'; +import { ErrorMessage, AuthInputBox } from '@components/Auth'; import { useNavigate } from 'react-router-dom'; import { SubmitHandler, useForm } from 'react-hook-form'; import { LoginFormVlaue } from '@/@types/auth.types'; @@ -60,7 +60,7 @@ const Login = () => {
- { inputValue={watch('email')} setValue={setValue} /> - { @@ -12,8 +12,8 @@ const Signup = () => { 회원가입을 해주세요 - - + + {/* TODO 서지수 | 모든 조건이 만족되어야지만 활성화되도록 수정 */}
diff --git a/src/utils/user/validationList.ts b/src/utils/Auth/validationList.ts similarity index 100% rename from src/utils/user/validationList.ts rename to src/utils/Auth/validationList.ts From 58b1eb6ad08490927511f8d7a5932d88775e8d5c Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 16:18:10 +0900 Subject: [PATCH 5/8] =?UTF-8?q?Refactor:=20=EC=B9=B4=EC=B9=B4=EC=98=A4?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=EB=B2=84=ED=8A=BC=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Auth/KakaoLoginButton.tsx | 12 ++++++++++++ src/components/Auth/index.ts | 9 ++++++++- src/pages/login/login.page.tsx | 10 +++------- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 src/components/Auth/KakaoLoginButton.tsx diff --git a/src/components/Auth/KakaoLoginButton.tsx b/src/components/Auth/KakaoLoginButton.tsx new file mode 100644 index 00000000..333f4307 --- /dev/null +++ b/src/components/Auth/KakaoLoginButton.tsx @@ -0,0 +1,12 @@ +import { KakaoIcon } from '@components/common/icons/Icons'; + +const KakaoLoginButton = () => { + return ( + + ); +}; + +export default KakaoLoginButton; diff --git a/src/components/Auth/index.ts b/src/components/Auth/index.ts index 3be1288d..7969844f 100644 --- a/src/components/Auth/index.ts +++ b/src/components/Auth/index.ts @@ -2,5 +2,12 @@ import AuthInputBox from './AuthInputBox/AuthInputBox'; import AuthEmailInputBox from './AuthInputBox/AuthEmailInputBox'; import AuthPwInputBox from './AuthInputBox/AuthPwInputBox'; import ErrorMessage from './ErrorMessage'; +import KakaoLoginButton from './KakaoLoginButton'; -export { AuthInputBox, AuthEmailInputBox, AuthPwInputBox, ErrorMessage }; +export { + AuthInputBox, + AuthEmailInputBox, + AuthPwInputBox, + ErrorMessage, + KakaoLoginButton, +}; diff --git a/src/pages/login/login.page.tsx b/src/pages/login/login.page.tsx index ed4e8b7b..ff44f70b 100644 --- a/src/pages/login/login.page.tsx +++ b/src/pages/login/login.page.tsx @@ -2,8 +2,8 @@ import { postEmailLogin } from '@api/auth'; import authCient from '@api/authClient'; import SubmitBtn from '@components/common/button/SubmitBtn'; import Back from '@components/common/back/Back'; -import { KakaoIcon, LogoIcon } from '@components/common/icons/Icons'; -import { ErrorMessage, AuthInputBox } from '@components/Auth'; +import { LogoIcon } from '@components/common/icons/Icons'; +import { ErrorMessage, AuthInputBox, KakaoLoginButton } from '@components/Auth'; import { useNavigate } from 'react-router-dom'; import { SubmitHandler, useForm } from 'react-hook-form'; import { LoginFormVlaue } from '@/@types/auth.types'; @@ -20,7 +20,6 @@ const Login = () => { formState: { errors }, } = useForm({ reValidateMode: 'onSubmit', - // 다른 옵션들... }); const [isLoginFailed, setIsLoginFailed] = useState(false); @@ -105,10 +104,7 @@ const Login = () => { 또는
- + 회원가입 From 1e43bd49ccc9b1a750179120722ea5761a167066 Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 19:19:51 +0900 Subject: [PATCH 6/8] =?UTF-8?q?Refactor:=20login=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@types/auth.types.ts | 4 ++-- src/api/auth.ts | 4 ++-- src/components/Auth/AuthInputBox/AuthInputBox.tsx | 1 - src/pages/login/login.page.tsx | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/@types/auth.types.ts b/src/@types/auth.types.ts index c95769ab..68022c80 100644 --- a/src/@types/auth.types.ts +++ b/src/@types/auth.types.ts @@ -1,4 +1,4 @@ -export interface AuthRequest { +interface AuthRequest { email: string; password: string; name: string; @@ -9,7 +9,7 @@ export interface AuthRequest { survey: string; } -export interface LoginFormVlaue { +interface LoginFormVlaue { email: string; password: string; } diff --git a/src/api/auth.ts b/src/api/auth.ts index b9abe8cf..53f8ce9f 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -21,13 +21,13 @@ export const postSignup = async (authData: AuthRequest) => { }; // 로그인-이메일 -export const postEmailLogin = async (LoginData: LoginRequest) => { +export const postEmailLogin = async (LoginData: LoginFormVlaue) => { const res = await client.post(`auth/login`, LoginData); return res; }; // 로그인-카카오 -export const postKakaoLogin = async (LoginData: LoginRequest) => { +export const postKakaoLogin = async (LoginData: LoginFormVlaue) => { const res = await client.post(`auth/login/kakao`, LoginData); return res; }; diff --git a/src/components/Auth/AuthInputBox/AuthInputBox.tsx b/src/components/Auth/AuthInputBox/AuthInputBox.tsx index 481bc27f..2880d0a8 100644 --- a/src/components/Auth/AuthInputBox/AuthInputBox.tsx +++ b/src/components/Auth/AuthInputBox/AuthInputBox.tsx @@ -1,6 +1,5 @@ import { CloseIcon } from '@components/common/icons/Icons'; import { UseFormRegisterReturn, UseFormSetValue } from 'react-hook-form'; -import { LoginFormVlaue } from '@/@types/auth.types'; interface Props { label: string; diff --git a/src/pages/login/login.page.tsx b/src/pages/login/login.page.tsx index ff44f70b..bf455f59 100644 --- a/src/pages/login/login.page.tsx +++ b/src/pages/login/login.page.tsx @@ -6,7 +6,6 @@ import { LogoIcon } from '@components/common/icons/Icons'; import { ErrorMessage, AuthInputBox, KakaoLoginButton } from '@components/Auth'; import { useNavigate } from 'react-router-dom'; import { SubmitHandler, useForm } from 'react-hook-form'; -import { LoginFormVlaue } from '@/@types/auth.types'; import { useState } from 'react'; import { AxiosError } from 'axios'; From 9dda1407e85ce3a2156befd9ae482cb9e7877c9a Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 19:20:14 +0900 Subject: [PATCH 7/8] =?UTF-8?q?Style:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=A4=ED=8C=A8=20=EA=B2=BD=EA=B3=A0=20=EB=AC=B8=EA=B5=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/login.page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/login/login.page.tsx b/src/pages/login/login.page.tsx index bf455f59..644bb7b4 100644 --- a/src/pages/login/login.page.tsx +++ b/src/pages/login/login.page.tsx @@ -87,7 +87,7 @@ const Login = () => { {!errors.email && !errors.password && isLoginFailed && ( <> - 아이디(로그인 전용 아이디) 또는 비밀번호를 잘못 입력했습니다. + 이메일 또는 비밀번호를 잘못 입력했습니다. 입력하신 내용을 다시 확인해주세요. From e3d98f7fefa95afc0cf35c72e09765777879cae1 Mon Sep 17 00:00:00 2001 From: jisu Seo Date: Sat, 6 Jan 2024 19:21:07 +0900 Subject: [PATCH 8/8] =?UTF-8?q?Feat:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=9E=84=EC=8B=9C=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Auth/KakaoLoginButton.tsx | 13 ++++++++++++- src/pages/index.ts | 4 ++-- src/pages/login/index.ts | 4 ++++ src/pages/login/loginKakao.page.tsx | 19 +++++++++++++++++++ src/router/authRouter.tsx | 3 ++- 5 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 src/pages/login/index.ts create mode 100644 src/pages/login/loginKakao.page.tsx diff --git a/src/components/Auth/KakaoLoginButton.tsx b/src/components/Auth/KakaoLoginButton.tsx index 333f4307..8d871741 100644 --- a/src/components/Auth/KakaoLoginButton.tsx +++ b/src/components/Auth/KakaoLoginButton.tsx @@ -1,8 +1,19 @@ import { KakaoIcon } from '@components/common/icons/Icons'; const KakaoLoginButton = () => { + const VITE_KAKAO_LOGIN_TEST_API_KEY = import.meta.env + .VITE_KAKAO_LOGIN_TEST_API_KEY; + const REDIRECT_URI = `${window.location.href}/kakao`; + const KAKAO_LOGIN_URL = `https://kauth.kakao.com/oauth/authorize?client_id=${VITE_KAKAO_LOGIN_TEST_API_KEY}&redirect_uri=${REDIRECT_URI}&response_type=code`; + + const onKakaoLoginClick = () => { + window.location.href = KAKAO_LOGIN_URL; + }; + return ( - diff --git a/src/pages/index.ts b/src/pages/index.ts index f281dab8..a92a70c4 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -1,4 +1,4 @@ import { Signup, SignupInfo } from './signup'; -import Login from './login/login.page'; +import { Login, LoginKakao } from './login'; -export { Signup, SignupInfo, Login }; +export { Signup, SignupInfo, Login, LoginKakao }; diff --git a/src/pages/login/index.ts b/src/pages/login/index.ts new file mode 100644 index 00000000..89b178eb --- /dev/null +++ b/src/pages/login/index.ts @@ -0,0 +1,4 @@ +import Login from './login.page'; +import LoginKakao from './loginKakao.page'; + +export { Login, LoginKakao }; diff --git a/src/pages/login/loginKakao.page.tsx b/src/pages/login/loginKakao.page.tsx new file mode 100644 index 00000000..78b84b79 --- /dev/null +++ b/src/pages/login/loginKakao.page.tsx @@ -0,0 +1,19 @@ +import { postKakaoLogin } from '@api/auth'; +import { useEffect } from 'react'; + +const LoginKakao = () => { + const code = new URL(window.location.href).searchParams.get('code'); + + useEffect(() => { + console.log(code); + try { + const res = postKakaoLogin(); + } catch (err) { + console.log('카카오 로그인 중 에러 발생'); + } + }, []); + + return
잠시만 기다려주세요
; +}; + +export default LoginKakao; diff --git a/src/router/authRouter.tsx b/src/router/authRouter.tsx index 520a7266..36598403 100644 --- a/src/router/authRouter.tsx +++ b/src/router/authRouter.tsx @@ -1,7 +1,7 @@ import { Routes, Route } from 'react-router-dom'; import MainLayout from './mainLayout'; import { Signup, SignupInfo } from '@pages/signup'; -import { Login } from '@pages/index'; +import { Login, LoginKakao } from '@pages/index'; const AuthRouter = () => { return ( @@ -10,6 +10,7 @@ const AuthRouter = () => { } /> } /> } /> + } /> );