11'use client' ;
2+ import { useState } from 'react' ;
23import { Icon } from '@/shared/icons' ;
34import { cn } from '@/shared/lib' ;
45import LoginButton from '@/pages/auth/components/LoginButton' ;
56import RecentLoginBubble from '@/pages/auth/components/RecentLoginBubble' ;
67
78export default function LoginPage ( ) {
8- const handleLoginClick = ( platform : string ) => alert ( `${ platform } 로그인` ) ;
9+ const [ recentPlatform , setRecentPlatform ] = useState < string | null > ( null ) ;
10+
11+ const handleLoginClick = ( platform : string ) => {
12+ alert ( `${ platform } 로그인 준비중` ) ;
13+ console . log ( `${ platform } 로그인 버튼 클릭` ) ;
14+ setRecentPlatform ( platform ) ;
15+ } ;
916
1017 return (
1118 < main className = 'w-full flex flex-col items-center bg-white' >
@@ -37,7 +44,7 @@ export default function LoginPage() {
3744 </ svg >
3845 </ div >
3946
40- { /* 콘텐츠 */ }
47+ { /* 콘텐츠 */ }
4148 < section
4249 className = { cn (
4350 'w-full flex flex-col items-center text-center' ,
@@ -50,7 +57,7 @@ export default function LoginPage() {
5057 < p className = 'text-label-md text-mint-900' >
5158 만화 속 부천 여행
5259 < br />
53- 8개 명소를 탐험하고 엽서를 모아보세요!
60+ 10개 명소를 탐험하고 엽서를 모아보세요!
5461 </ p >
5562 </ div >
5663
@@ -59,32 +66,47 @@ export default function LoginPage() {
5966 < Icon name = 'Stamp' size = { 132 } color = 'mint-400' />
6067 </ div >
6168
62- { /* 로그인 버튼 */ }
63- < div className = 'flex flex-col items-center gap-[2.1rem] relative' >
69+ < div className = 'flex flex-col items-center gap-[2.1rem]' >
6470 < p className = 'text-label-lg text-gray-400' > start with</ p >
6571
66- { /* 최근 로그인 말풍선 */ }
67- < div className = 'absolute -translate-x-1/2 z-50' >
68- < RecentLoginBubble />
69- </ div >
72+ < div className = 'flex gap-[1.5rem] relative' >
73+ { /* 카카오 */ }
74+ < div className = 'relative' >
75+ < LoginButton
76+ platform = 'kakao'
77+ onClick = { ( ) => handleLoginClick ( '카카오' ) }
78+ />
79+ { recentPlatform === '카카오' && (
80+ < div
81+ className = 'absolute -top-[3.8rem] left-1/2 -translate-x-1/2
82+ w-auto min-w-max h-auto flex-shrink-0 pointer-events-none'
83+ >
84+ < RecentLoginBubble />
85+ </ div >
86+ ) }
87+ </ div >
7088
71- { /* 로그인 버튼 */ }
72- < div className = 'flex gap-[1.5rem]' >
73- < LoginButton
74- platform = 'kakao'
75- onClick = { ( ) => handleLoginClick ( '카카오' ) }
76- />
77- < LoginButton
78- platform = 'google'
79- onClick = { ( ) => handleLoginClick ( '구글' ) }
80- />
89+ { /* 구글 */ }
90+ < div className = 'relative' >
91+ < LoginButton
92+ platform = 'google'
93+ onClick = { ( ) => handleLoginClick ( '구글' ) }
94+ />
95+ { recentPlatform === '구글' && (
96+ < div
97+ className = 'absolute -top-[3.8rem] left-1/2 -translate-x-1/2
98+ w-auto min-w-max h-auto flex-shrink-0 pointer-events-none'
99+ >
100+ < RecentLoginBubble />
101+ </ div >
102+ ) }
103+ </ div >
81104 </ div >
82105
83106 < p className = 'text-label-md text-gray-400 cursor-pointer underline underline-offset-[0.25rem]' >
84107 비회원 로그인
85108 </ p >
86109 </ div >
87-
88110 { /* 안내문 */ }
89111 < p className = 'mt-[5rem] text-label-sm text-gray-400' >
90112 비회원은 스탬프 저장과 공유 기능을 사용할 수 없습니다.
0 commit comments