11'use client' ;
22
3+ import BottomSheet from '@/components/common/BottomSheet' ;
34import Button from '@/components/common/Button' ;
5+ import OauthButton from '@/components/signup/OauthButton' ;
6+ import { OAUTH } from '@/constants/oauth' ;
47import { SEND_COMPLETE_SUBTEXT } from '@/constants/send/message' ;
58import { sendLetterState } from '@/recoil/letterStore' ;
69import { theme } from '@/styles/theme' ;
10+ import { OAuthType } from '@/types/login' ;
711import Image from 'next/image' ;
812import { useRouter , useSearchParams } from 'next/navigation' ;
9- import React , { useState } from 'react' ;
13+ import React , { useEffect , useState } from 'react' ;
1014import { useRecoilValue } from 'recoil' ;
1115import styled from 'styled-components' ;
1216
@@ -15,41 +19,84 @@ const SendCompletePage = () => {
1519 const searchParams = useSearchParams ( ) ;
1620 const isGuest = searchParams . get ( 'guest' ) === 'true' ;
1721 const { receiverName } = useRecoilValue ( sendLetterState ) ;
22+ const [ isDisplayed , setIsDisplayed ] = useState < boolean > ( false ) ;
23+ const [ isBottomUp , setIsBottomUp ] = useState < boolean > ( false ) ;
1824
1925 const subText = isGuest
2026 ? SEND_COMPLETE_SUBTEXT . guest
2127 : SEND_COMPLETE_SUBTEXT . member ;
2228
29+ const handleBottomUpChange = ( state : boolean ) => {
30+ setIsBottomUp ( state ) ;
31+ } ;
32+
33+ useEffect ( ( ) => {
34+ if ( isBottomUp ) {
35+ setIsDisplayed ( true ) ;
36+ } else {
37+ setTimeout ( ( ) => {
38+ setIsDisplayed ( false ) ;
39+ } , 490 ) ;
40+ }
41+ } , [ isBottomUp ] ) ;
42+
2343 const handleComplete = ( ) => {
2444 if ( isGuest ) {
45+ setIsBottomUp ( true ) ;
2546 } else {
2647 router . push ( '/planet' ) ;
2748 }
2849 } ;
2950
3051 return (
31- < Layout >
32- < Container >
33- < Title >
34- { receiverName } μκ²
35- < br />
36- νΈμ§λ₯Ό μ λ¬νμ΄μ!
37- < Sub > { subText } </ Sub >
38- </ Title >
39- < ImageWrapper >
40- < Image src = "/assets/send/send_complete.png" fill alt = "νΈμ§" />
41- </ ImageWrapper >
42- </ Container >
43- < ButtonWrapper >
44- < Button
45- buttonType = "primary"
46- text = {
47- isGuest ? 'νμκ°μ
νκ³ λ λ§μ κΈ°λ₯ μ΄μ©νκΈ°' : 'νμΌλ‘ λμκ°κΈ°'
48- }
49- onClick = { handleComplete }
50- />
51- </ ButtonWrapper >
52- </ Layout >
52+ < >
53+ < Layout >
54+ < Container >
55+ < Title >
56+ { receiverName } μκ²
57+ < br />
58+ νΈμ§λ₯Ό μ λ¬νμ΄μ!
59+ < Sub > { subText } </ Sub >
60+ </ Title >
61+ < ImageWrapper >
62+ < Image src = "/assets/send/send_complete.png" fill alt = "νΈμ§" />
63+ </ ImageWrapper >
64+ </ Container >
65+ < ButtonWrapper >
66+ < Button
67+ buttonType = "primary"
68+ text = {
69+ isGuest ? 'νμκ°μ
νκ³ λ λ§μ κΈ°λ₯ μ΄μ©νκΈ°' : 'νμΌλ‘ λμκ°κΈ°'
70+ }
71+ onClick = { handleComplete }
72+ />
73+ </ ButtonWrapper >
74+ { isDisplayed && (
75+ < BottomSheet
76+ height = { 290 }
77+ isOpen = { isBottomUp }
78+ handleOpen = { handleBottomUpChange }
79+ >
80+ < BottomWrapper >
81+ < SocialTitle > μμ
λ‘κ·ΈμΈ μ ν</ SocialTitle >
82+ < LoginList >
83+ { OAUTH . map ( ( item ) => (
84+ < OauthButton
85+ key = { item . key }
86+ shape = "list"
87+ loginType = { item . key as OAuthType }
88+ bgColor = { item . bgColor }
89+ icon = { item . icon }
90+ size = { item . miniSize }
91+ label = { item . label }
92+ />
93+ ) ) }
94+ </ LoginList >
95+ </ BottomWrapper >
96+ </ BottomSheet >
97+ ) }
98+ </ Layout >
99+ </ >
53100 ) ;
54101} ;
55102
@@ -62,21 +109,23 @@ const Layout = styled.div`
62109 width: 100%;
63110 height: 100%;
64111 color: ${ theme . colors . white } ;
65- padding: 76px 24px 54px 24px;
66112 overflow-x: hidden;
67- padding-bottom: 40px ;
113+ overflow-y: hidden ;
68114 background: ${ ( props ) => props . theme . colors . bg } ;
69115 background-image: url('/assets/send/img_send_background.png');
70116 background-size: cover;
71117 background-position: bottom 80px center;
72118 background-repeat: no-repeat;
73119 position: relative;
120+ z-index: 0;
74121` ;
75122
76123const Container = styled . div `
77124 width: 100%;
125+ height: 100%;
78126 display: flex;
79127 flex-direction: column;
128+ padding: 76px 24px 54px 24px;
80129 gap: 80px;
81130` ;
82131
@@ -105,16 +154,22 @@ const ImageWrapper = styled.div`
105154 align-items: center;
106155 justify-content: center;
107156
157+ @media (max-height: 680px) {
158+ width: 400px;
159+ height: 380px;
160+ top: 55%;
161+ }
162+
108163 @media (max-height: 580px) {
109164 width: 350px;
110165 height: 340px;
111- top: 55 %;
166+ top: 58 %;
112167 }
113168
114169 @media (max-height: 550px) {
115170 width: 300px;
116171 height: 290px;
117- top: 55 %;
172+ top: 58 %;
118173 }
119174` ;
120175
@@ -128,3 +183,23 @@ const ButtonWrapper = styled.div`
128183 bottom: 54px;
129184 left: 0;
130185` ;
186+
187+ const BottomWrapper = styled . div `
188+ display: flex;
189+ flex-direction: column;
190+ align-items: flex-start;
191+ gap: 26px;
192+ ` ;
193+
194+ const SocialTitle = styled . p `
195+ color: ${ theme . colors . gray100 } ;
196+ ${ theme . fonts . title02 } ;
197+ ` ;
198+
199+ const LoginList = styled . div `
200+ display: flex;
201+ flex-direction: column;
202+ align-items: flex-start;
203+ padding: 0 14px;
204+ gap: 24px;
205+ ` ;
0 commit comments