-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FE] feat: 소셜 연동 로그인 버튼 및 로그인 요청 모달 #1022
Open
ImxYJL
wants to merge
7
commits into
develop
Choose a base branch
from
fe/feat/1019-github-login-button-and-request-login-modal
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+136
−0
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
67027db
feat: LoginButton 컴포넌트트
ImxYJL 15b5954
feat: GithubLoginButton 컴포넌트트
ImxYJL 4771c82
chore: component 파일의 index에 GithubLoginButton, LoginButton 추가가
ImxYJL 955d672
refactor: style 전용 인터페이스 분리 및 공통 컴포넌트 import 경로 수정정
ImxYJL 5ab71db
chore: modals의 index에 ContentModal 추가가
ImxYJL ce28545
feat: LoginRequestModal 컴포넌트트
ImxYJL d86064f
refactor: 클릭 핸들러 네이밍 간소화
ImxYJL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
frontend/src/components/common/GithubLoginButton/index.tsx
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import GithubWhiteLogoIcon from '@/assets/githubWhiteLogo.svg'; | ||
import { LoginButtonStyleProps } from '@/components/common/LoginButton'; | ||
import { LoginButton } from '@/components/index'; | ||
|
||
interface GithubLoginButtonProps extends LoginButtonStyleProps { | ||
handleClick: () => void; | ||
} | ||
|
||
const GithubLoginButton = ({ handleClick, $logoStyle, $style }: GithubLoginButtonProps) => { | ||
return ( | ||
<LoginButton | ||
platform="깃허브" | ||
engPlatform="github" | ||
handleClick={handleClick} | ||
logoSrc={GithubWhiteLogoIcon} | ||
$logoStyle={$logoStyle} | ||
$style={$style} | ||
></LoginButton> | ||
); | ||
}; | ||
|
||
export default GithubLoginButton; |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Button } from '@/components/index'; | ||
import { calculateParticle } from '@/utils'; | ||
|
||
import * as S from './styles'; | ||
|
||
interface LoginButtonProps extends LoginButtonStyleProps { | ||
platform: string; | ||
engPlatform?: string; | ||
logoSrc: string; | ||
handleClick: () => void; | ||
} | ||
|
||
export interface LoginButtonStyleProps { | ||
$logoStyle?: React.CSSProperties; | ||
$style?: React.CSSProperties; | ||
} | ||
|
||
const LoginButton = ({ | ||
platform, | ||
engPlatform, | ||
logoSrc, | ||
handleClick, | ||
$logoStyle, | ||
$style, | ||
}: LoginButtonProps) => { | ||
return ( | ||
<Button onClick={handleClick} styleType="primary" style={$style}> | ||
<S.ButtonLabelContainer> | ||
<S.LogoImg src={logoSrc} alt={`${platform} 로고`} $logoStyle={$logoStyle} /> | ||
<span> | ||
{engPlatform || platform} | ||
{calculateParticle({ | ||
target: platform, | ||
particles: { withFinalConsonant: '으로', withoutFinalConsonant: '로' }, | ||
})}{' '} | ||
로그인하기 | ||
</span> | ||
</S.ButtonLabelContainer> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default LoginButton; |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import { LoginButtonStyleProps } from './index'; | ||
|
||
export const ButtonLabelContainer = styled.div` | ||
display: flex; | ||
gap: 0.8rem; | ||
align-items: center; | ||
`; | ||
|
||
export const LogoImg = styled.img<Omit<LoginButtonStyleProps, '$style' >>` | ||
width: 3.2rem; | ||
height: 3.2rem; | ||
|
||
${({ $logoStyle }) => $logoStyle && { ...$logoStyle }}; | ||
`; |
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,3 +1,4 @@ | ||
export { default as ConfirmModal } from './ConfirmModal'; | ||
export { default as AlertModal } from './AlertModal'; | ||
export { default as ErrorAlertModal } from './ErrorAlertModal'; | ||
export { default as ContentModal } from './ContentModal'; |
32 changes: 32 additions & 0 deletions
32
frontend/src/pages/ReviewWritingPage/modals/components/LoginRequestModal/index.tsx
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ContentModal, GithubLoginButton } from '@/components'; | ||
|
||
import * as S from './styles'; | ||
|
||
type LoginRequestTitleType = 'loginIntent' | 'membershipCheck'; | ||
|
||
interface LoginRequestModalProps { | ||
titleType: LoginRequestTitleType; | ||
closeModal: () => void; | ||
} | ||
|
||
const LoginRequestModal = ({ titleType, closeModal }: LoginRequestModalProps) => { | ||
const getTitleLabel = (titleType: LoginRequestTitleType) => { | ||
if (titleType === 'loginIntent') return '로그인하시겠어요?'; | ||
if (titleType === 'membershipCheck') return '회원이신가요?'; | ||
}; | ||
|
||
return ( | ||
<ContentModal title={getTitleLabel(titleType)} handleClose={closeModal} isClosableOnBackground={true} $style={{}}> | ||
<S.LoginRequestModal> | ||
<S.LoginRequestLabel>로그인 후 간편하게 받은 리뷰를 확인하세요!</S.LoginRequestLabel> | ||
<GithubLoginButton | ||
handleClick={() => {}} | ||
$logoStyle={{ height: '3rem' }} | ||
$style={{ fontSize: '1.3rem', height: '4rem', width: '100%' }} | ||
/> | ||
</S.LoginRequestModal> | ||
</ContentModal> | ||
); | ||
}; | ||
|
||
export default LoginRequestModal; |
11 changes: 11 additions & 0 deletions
11
frontend/src/pages/ReviewWritingPage/modals/components/LoginRequestModal/styles.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
export const LoginRequestModal = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
`; | ||
|
||
export const LoginRequestLabel = styled.p` | ||
margin-bottom: 1rem; | ||
font-size: 1.4rem; | ||
`; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그인하기
앞에 띄어쓰기를 하는 방법으로 구현할 수 있지만 공백이 명시적으로 있다는 것을 표현하기 위해 {' '} 를 사용했습니다.