forked from SWYP-team-2th/client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
비회원일 경우 특정 버튼 클릭시, 로그인 팝업 띄우기 (SWYP-team-2th#182)
* 비회원일 경우 특정 버튼 클릭시, 로그인 팝업 띄우기 * 비회원 문구 추가 * 마감 시 UI 반영 안되는 문제 수정
- Loading branch information
Showing
11 changed files
with
109 additions
and
17 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
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,27 @@ | ||
import Dialog from '../Dialog'; | ||
import useLoginDialog from './hooks'; | ||
|
||
export default function LoginDialog() { | ||
const { handleLogin } = useLoginDialog(); | ||
|
||
return ( | ||
<Dialog | ||
title={ | ||
<> | ||
당신의 선택은? | ||
<br /> | ||
로그인하고 투표에 참여하세요! | ||
</> | ||
} | ||
description="로그인하고 나만의 투표를 만들고 공유하세요." | ||
confirmButtonProps={{ | ||
text: '카카오로 계속하기', | ||
onClick: () => { | ||
console.log('hi'); | ||
handleLogin(); | ||
}, | ||
}} | ||
showLaterButton={true} | ||
/> | ||
); | ||
} |
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,15 @@ | ||
import { getIsDevelopment } from '@/utils/cn/getEnvironment'; | ||
|
||
export default function useLoginDialog() { | ||
const isDevelopment = getIsDevelopment(); | ||
const pathname = window.location.pathname; | ||
|
||
const KAKAO_AUTH_URL = `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${isDevelopment ? import.meta.env.VITE_KAKAO_CLIENT_ID : import.meta.env.VITE_KAKAO_PROD_CLIENT_ID}&redirect_uri=${window.location.origin}/oauth&state=${pathname}`; | ||
const handleLogin = () => { | ||
window.location.href = KAKAO_AUTH_URL; | ||
}; | ||
|
||
return { | ||
handleLogin, | ||
}; | ||
} |
Empty file.
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
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