-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSocialLoginStep.tsx
More file actions
55 lines (46 loc) · 1.62 KB
/
SocialLoginStep.tsx
File metadata and controls
55 lines (46 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import Chippi from '@assets/chippi_extension_popup.svg';
import GoogleLogo from '/assets/onBoarding/icons/googleLogo.svg';
const SocialLoginStep = () => {
const handleGoogleLogin = () => {
const clientId = import.meta.env.VITE_GOOGLE_CLIENT_ID;
const redirectUri = import.meta.env.VITE_GOOGLE_REDIRECT_URI;
if (!clientId || !redirectUri) {
alert('Google OAuth 설정이 누락되었습니다.');
return;
}
const googleAuthUrl =
`https://accounts.google.com/o/oauth2/v2/auth?` +
`client_id=${clientId}` +
`&redirect_uri=${redirectUri}` +
`&response_type=code` +
`&scope=email profile`;
window.location.href = googleAuthUrl;
};
return (
<div className="flex flex-col items-center justify-center pt-6">
<img
src={Chippi}
alt="치삐 이미지"
className="h-[19.4rem] w-[19.4rem] object-contain"
/>
<h1 className="head2 text-font-black-1 mb-[0.8rem] text-center">
치삐를 만나려면 로그인이 필요해요!
</h1>
<p className="body2-m text-font-gray-3 mb-[3.5rem] text-center">
로그인하고 북마크한 정보를 리마인드를 받아보세요.
</p>
<button
onClick={handleGoogleLogin}
className="sub2-sb flex h-[5.2rem] w-[22.7rem] items-center justify-between gap-3 rounded-full border border-gray-100 bg-white px-[2rem]"
>
<img
src={GoogleLogo}
alt="구글 로고"
className="h-[2.435rem] w-[2.435rem]"
/>
구글 계정으로 로그인
</button>
</div>
);
};
export default SocialLoginStep;