@@ -7,10 +7,16 @@ import { Button } from "@/components/ui/button.tsx";
77import { useCustomToast } from "@/hooks/common/useCustomToast.ts" ;
88
99import { TOAST_MESSAGES } from "@/constants/messages.ts" ;
10+ import { BASE_URL , OAUTH } from "@/constants/endpoints.ts" ;
1011
1112export const AuthSocialLoginButtons = ( ) => {
1213 const { toast } = useCustomToast ( ) ;
13- const handleSocialLogin = ( ) => {
14+
15+ const handleSocialLogin = ( provider : "google" | "github" ) => {
16+ window . location . href = `${ BASE_URL } ${ OAUTH . LOGIN } ?type=${ provider } ` ;
17+ } ;
18+
19+ const handleNotPrepared = ( ) => {
1420 toast ( TOAST_MESSAGES . SERVICE_NOT_PREPARED ) ;
1521 } ;
1622
@@ -26,19 +32,19 @@ export const AuthSocialLoginButtons = () => {
2632 </ div >
2733
2834 < div className = "grid gap-2" >
29- < Button variant = "outline" className = "w-full" onClick = { handleSocialLogin } >
35+ < Button variant = "outline" className = "w-full" onClick = { ( ) => handleSocialLogin ( "github" ) } >
3036 < GitHub />
3137 < span className = "text-muted-foreground" > Github로 계속하기</ span >
3238 </ Button >
33- < Button variant = "outline" className = "w-full" onClick = { handleSocialLogin } >
39+ < Button variant = "outline" className = "w-full" onClick = { ( ) => handleSocialLogin ( "google" ) } >
3440 < Google />
3541 < span className = "text-muted-foreground" > Google로 계속하기</ span >
3642 </ Button >
37- < Button variant = "outline" className = "w-full" onClick = { handleSocialLogin } >
43+ < Button variant = "outline" className = "w-full" onClick = { handleNotPrepared } >
3844 < Naver className = "text-[#03C75A]" />
3945 < span className = "text-muted-foreground" > 네이버로 계속하기</ span >
4046 </ Button >
41- < Button variant = "outline" className = "w-full" onClick = { handleSocialLogin } >
47+ < Button variant = "outline" className = "w-full" onClick = { handleNotPrepared } >
4248 < Kakao className = "text-[#FEE500]" />
4349 < span className = "text-muted-foreground" > 카카오로 계속하기</ span >
4450 </ Button >
0 commit comments