-
Notifications
You must be signed in to change notification settings - Fork 7
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 #115 from codestates-seb/dev-client#19/watchList
[Feat]회원가입 로그인 develop
- Loading branch information
Showing
15 changed files
with
359 additions
and
204 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 |
---|---|---|
@@ -1,21 +1,49 @@ | ||
// GoogleLoginButton.tsx | ||
|
||
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'; | ||
|
||
interface Props { | ||
backendURL: string; | ||
} | ||
|
||
const GoogleLoginButton: React.FC<Props> = ({ backendURL }) => { | ||
const dispatch = useDispatch(); | ||
|
||
const buttonText = "Login with Google"; | ||
|
||
const handleLoginClick = () => { | ||
window.location.href = `${backendURL}`; | ||
dispatch(setLoginState()); // 로그인 상태를 변경합니다. | ||
}; | ||
|
||
return ( | ||
<button onClick={handleLoginClick}> | ||
Login with Google | ||
</button> | ||
<GoogleButton onClick={handleLoginClick}> | ||
<LogoImage src={googleLogo} alt="Google Logo" /> | ||
{buttonText} | ||
</GoogleButton> | ||
); | ||
} | ||
|
||
// Styled Components | ||
const GoogleButton = styled.button` | ||
margin: 10px 0; | ||
padding: 10px 20px; | ||
background-color: #FFFFFF; | ||
border: 1px solid lightgray; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
width: 300px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
const LogoImage = styled.img` | ||
margin-right: 30px; | ||
width: 60px; | ||
height: auto; | ||
`; | ||
|
||
export default GoogleLoginButton; |
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 |
---|---|---|
@@ -1,21 +1,51 @@ | ||
// KakaoLoginButton.tsx | ||
|
||
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'; | ||
|
||
interface Props { | ||
backendURL: string; | ||
} | ||
|
||
const KakaoLoginButton: React.FC<Props> = ({ backendURL }) => { | ||
const dispatch = useDispatch(); | ||
|
||
const buttonText = "Login with Kakao"; | ||
|
||
const handleLoginClick = () => { | ||
window.location.href = `${backendURL}`; | ||
dispatch(setLoginState()); // 로그인 상태를 변경합니다. | ||
}; | ||
|
||
return ( | ||
<button onClick={handleLoginClick}> | ||
Login with Kakao | ||
</button> | ||
<KakaoButton onClick={handleLoginClick}> | ||
<LogoImage src={kakaoLogo} alt="Kakao Logo" /> | ||
{buttonText} | ||
</KakaoButton> | ||
); | ||
} | ||
|
||
// Styled Components | ||
const KakaoButton = styled.button` | ||
margin: 10px 0; | ||
padding: 10px 20px; | ||
background-color: #FFFFFF; | ||
border: 1px solid lightgray; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
width: 300px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
const LogoImage = styled.img` | ||
margin-right: 30px; | ||
width: 60px; | ||
height: auto; | ||
`; | ||
|
||
export default KakaoLoginButton; |
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
Oops, something went wrong.