File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { useLocation , useNavigate } from 'react-router-dom'
3+ import Button from '@components/Button'
4+ import { ReactComponent as HeartIcon } from '@assets/heart_large.svg'
5+ import { ReactComponent as CloseIcon } from '@assets/close_icon.svg'
6+ import { getFormattedDate } from '@utils/getFormattedDate'
7+
8+ export default function WithdrawSignUp ( ) {
9+ const navigate = useNavigate ( )
10+ const { state } = useLocation ( )
11+
12+ return (
13+ < >
14+ < CloseIcon
15+ className = "ml-6 mt-4 cursor-pointer"
16+ onClick = { ( ) => navigate ( '/' , { replace : true } ) }
17+ />
18+ < div className = "flex h-full flex-col items-center justify-center px-5" >
19+ < HeartIcon className = "mb-10" />
20+ < p className = "mb-14 text-center text-[20px] font-semibold leading-[30px] text-grey-10" >
21+ < span className = "text-primary-2" >
22+ { getFormattedDate ( new Date ( state . date ) , 'point' ) } { ' ' }
23+ </ span >
24+ ์ดํ๋ก
25+ < br />
26+ ์ฌ๊ฐ์
์ด ๊ฐ๋ฅํด์
27+ </ p >
28+ < Button
29+ disabled = { false }
30+ property = "solid"
31+ onClick = { ( ) => navigate ( '/' , { replace : true } ) }
32+ >
33+ ๋ ์ฝ๋ง ๋๋ฌ๋ณด๊ธฐ
34+ </ Button >
35+ </ div >
36+ </ >
37+ )
38+ }
Original file line number Diff line number Diff line change @@ -52,7 +52,15 @@ export const useAuth = () => {
5252 onSuccess : ( ) => {
5353 redirectPage ( )
5454 } ,
55- onError : ( ) => {
55+ onError : ( error : AxiosError ) => {
56+ if ( error . response ?. status === 403 ) {
57+ const { data } = error . response as AxiosResponse
58+ navigate ( '/sign-up/fail' , {
59+ state : { date : data . msg } ,
60+ } )
61+ return
62+ }
63+
5664 navigate ( '/login' )
5765 } ,
5866 }
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ const CompletedWithdraw = lazy(
3636)
3737const AddRecord = lazy ( ( ) => import ( '@pages/AddRecord/AddRecord' ) )
3838const DetailRecord = lazy ( ( ) => import ( '@pages/DetailRecord/DetailRecord' ) )
39+ const WithdrawSignUp = lazy ( ( ) => import ( '@pages/SignUp/WithdrawSignUp' ) )
3940
4041const router = createBrowserRouter ( [
4142 {
@@ -146,17 +147,19 @@ const router = createBrowserRouter([
146147 {
147148 path : 'check' ,
148149 element : (
149- < ProtectedRoute route = { '/setting/withdraw/check' } >
150- < CheckedNicknameBeforeWithDraw />
151- </ ProtectedRoute >
150+ < Suspense fallback = { < Loading /> } >
151+ < ProtectedRoute route = { '/setting/withdraw/check' } >
152+ < CheckedNicknameBeforeWithDraw />
153+ </ ProtectedRoute >
154+ </ Suspense >
152155 ) ,
153156 } ,
154157 {
155158 path : 'complete' ,
156159 element : (
157- < ProtectedRoute route = { '/setting/withdraw/complete' } >
160+ < Suspense fallback = { < Loading /> } >
158161 < CompletedWithdraw />
159- </ ProtectedRoute >
162+ </ Suspense >
160163 ) ,
161164 } ,
162165 ] ,
@@ -187,6 +190,14 @@ const router = createBrowserRouter([
187190 </ Suspense >
188191 ) ,
189192 } ,
193+ {
194+ path : '/sign-up/fail' ,
195+ element : (
196+ < Suspense fallback = { < Loading /> } >
197+ < WithdrawSignUp />
198+ </ Suspense >
199+ ) ,
200+ } ,
190201 {
191202 path : '/record/add' ,
192203 element : (
You canโt perform that action at this time.
0 commit comments