File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { useMutation } from '@tanstack/react-query' ;
2
+ import { useNavigate } from 'react-router-dom' ;
2
3
import ordersApi from '@/apis/orders/ordersApi' ;
4
+ import RoutePath from '@/routes/routePath' ;
3
5
4
6
const usePostOrder = ( ) => {
7
+ const navigate = useNavigate ( ) ;
5
8
const { mutate : postOrder , ...rest } = useMutation ( {
6
- mutationFn : ordersApi . POST_ORDER
9
+ mutationFn : ordersApi . POST_ORDER ,
10
+ onError : ( ) => navigate ( RoutePath . PaymentsFail )
7
11
} ) ;
8
12
9
13
return { postOrder, ...rest } ;
Original file line number Diff line number Diff line change 1
1
import { useEffect } from 'react' ;
2
2
import { useNavigate , useSearchParams } from 'react-router-dom' ;
3
- import { Flex , Text } from '@/components/common/Wrapper' ;
3
+ import { Flex , Text , Space } from '@/components/common/Wrapper' ;
4
4
import { media } from '@/styles' ;
5
5
import styled from '@emotion/styled' ;
6
6
@@ -47,8 +47,8 @@ export function PaymentsSuccess() {
47
47
} , [ searchParams ] ) ;
48
48
49
49
return (
50
- < Wrapper direction = "column" gap = "lg" justify = "start " >
51
- < Flex direction = "column" justify = "space-between ">
50
+ < Wrapper direction = "column" justify = "space-between " >
51
+ < Flex direction = "column" gap = "lg ">
52
52
< Heading typo = "h1" color = "black" >
53
53
회비 결제 완료
54
54
</ Heading >
@@ -57,7 +57,10 @@ export function PaymentsSuccess() {
57
57
< Text > 이제 GDSC 정회원으로 이번 학기에 활동하실 수 있어요!</ Text >
58
58
</ Flex >
59
59
</ Flex >
60
- < Button onClick = { ( ) => navigate ( RoutePath . Dashboard ) } > 완료하기</ Button >
60
+ < Flex direction = "column" >
61
+ < Button onClick = { ( ) => navigate ( RoutePath . Dashboard ) } > 완료하기</ Button >
62
+ < Space height = { 28 } />
63
+ </ Flex >
61
64
</ Wrapper >
62
65
) ;
63
66
}
You can’t perform that action at this time.
0 commit comments