diff --git a/client/src/components/Logins/GoogleLoginButton.tsx b/client/src/components/Logins/GoogleLoginButton.tsx index 67f32b07..7ac0df58 100644 --- a/client/src/components/Logins/GoogleLoginButton.tsx +++ b/client/src/components/Logins/GoogleLoginButton.tsx @@ -1,18 +1,13 @@ import React from 'react'; import styled from 'styled-components'; -import { useDispatch } from 'react-redux'; -import { setLoginState } from '../../reducer/member/loginSlice'; import googleLogo from '../../asset/images/GoogleLogo.svg'; const GoogleLoginButton: React.FC = ({ backendURL }) => { - const dispatch = useDispatch(); const buttonText = "구글로 로그인"; - //버튼 클릭시 로그인 상태를 1로 변경 const handleLoginClick = () => { window.location.href = `${backendURL}`; - dispatch(setLoginState()); }; return ( diff --git a/client/src/components/Logins/KakaoLoginButton.tsx b/client/src/components/Logins/KakaoLoginButton.tsx index 3956665e..bbbdaaa8 100644 --- a/client/src/components/Logins/KakaoLoginButton.tsx +++ b/client/src/components/Logins/KakaoLoginButton.tsx @@ -1,18 +1,14 @@ import React from 'react'; import styled from 'styled-components'; -import { useDispatch } from 'react-redux'; -import { setLoginState } from '../../reducer/member/loginSlice'; import kakaoLogo from '../../asset/images/KakaoLogo.svg'; const KakaoLoginButton: React.FC = ({ backendURL }) => { - const dispatch = useDispatch(); const buttonText = "카카오로 로그인"; // 버튼 클릭시 로그인 페이지로 리다이렉트 const handleLoginClick = () => { window.location.href = `${backendURL}`; - dispatch(setLoginState()); // 로그인 상태를 변경합니다. }; return ( diff --git a/client/src/components/Logins/OAuthLogin.tsx b/client/src/components/Logins/OAuthLogin.tsx index 4196d94b..b6ad1153 100644 --- a/client/src/components/Logins/OAuthLogin.tsx +++ b/client/src/components/Logins/OAuthLogin.tsx @@ -6,7 +6,7 @@ import { useSelector } from 'react-redux'; import { RootState } from '../../store/config'; -const OAuthLoginModal: React.FC = ({ onClose, onEmailLoginClick, onEmailSignupClick, onLoginSuccess }) => { +const OAuthLoginModal: React.FC = ({ onClose, onEmailLoginClick, onEmailSignupClick }) => { const titleText = "로그인"; const orText = "또는"; const emailLoginText = "이메일로 로그인"; @@ -22,7 +22,6 @@ const OAuthLoginModal: React.FC = ({ onClose, onEmailLoginClick // 이미 로그인상태라면 모달창 닫기 useEffect(() => { if (loginState === 1) { - onLoginSuccess(); onClose(); } }, [loginState, onClose]); @@ -51,7 +50,7 @@ interface LoginModalProps { onClose: () => void; onEmailLoginClick: () => void; onEmailSignupClick: () => void; - onLoginSuccess: () => void; + onLoginSuccess?: () => void; onWatchListClick: () => void; onHoldingsClick: () => void; } diff --git a/client/src/page/MainPage.tsx b/client/src/page/MainPage.tsx index c408f1a6..498d4771 100644 --- a/client/src/page/MainPage.tsx +++ b/client/src/page/MainPage.tsx @@ -195,7 +195,6 @@ const MainPage = () => { onClose={closeOAuthModal} onEmailLoginClick={openEmailLoginModal} onEmailSignupClick={openEmailSignupModal} - onLoginSuccess={handleOAuthLoginSuccess} // 추가된 부분 onWatchListClick={() => handleMenuChange("관심종목")} onHoldingsClick={() => handleMenuChange("보유종목")} />