-
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.
Merge pull request #67 from Prography-9th-3team/fix/style-layout
Fix/사이드바 & 로그인 페이지 스타일 수정
- Loading branch information
Showing
6 changed files
with
134 additions
and
57 deletions.
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.
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,41 @@ | ||
import apis from '@/apis/api'; | ||
import Icon from '@/components/common/Icon'; | ||
|
||
const GoogleButton = () => { | ||
const redirectUri = process.env.NEXT_PUBLIC_LOGIN_REDIRECT_URL; | ||
|
||
const handleLogin = () => { | ||
try { | ||
const popupWidth = 600; | ||
const popupHeight = 730; | ||
|
||
const screenWidth = window.innerWidth; | ||
const screenHeight = window.innerHeight; | ||
|
||
const popupLeft = (screenWidth - popupWidth) / 2 + window.screenX; | ||
const popupTop = (screenHeight - popupHeight) / 2 + window.screenY; | ||
|
||
const loginRedirectUri = apis.auth.google_login(redirectUri as string); | ||
|
||
window.open( | ||
loginRedirectUri, | ||
'Packit Login', | ||
`width=${popupWidth},height=${popupHeight},left=${popupLeft},top=${popupTop},scrollbars=yes,resizable=yes`, | ||
); | ||
} catch (error) { | ||
console.error('Error during Google login:', error); | ||
} | ||
}; | ||
|
||
return ( | ||
<button | ||
onClick={handleLogin} | ||
className='w-full h-48 px-16 py-12 text-secondary label-lg border border-border rounded-lg flex justify-center items-center gap-8' | ||
> | ||
<Icon name='google' /> | ||
<span>Google 계정으로 로그인</span> | ||
</button> | ||
); | ||
}; | ||
|
||
export default GoogleButton; |
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