Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] 토스페이먼츠 QA 개선 반영 #93

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/hooks/mutation/usePostOrder.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { useMutation } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';
import ordersApi from '@/apis/orders/ordersApi';
import RoutePath from '@/routes/routePath';

const usePostOrder = () => {
const navigate = useNavigate();
const { mutate: postOrder, ...rest } = useMutation({
mutationFn: ordersApi.POST_ORDER
mutationFn: ordersApi.POST_ORDER,
onError: () => navigate(RoutePath.PaymentsFail)
});

return { postOrder, ...rest };
Expand Down
11 changes: 7 additions & 4 deletions src/pages/PaymentsSuccess.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { Flex, Text } from '@/components/common/Wrapper';
import { Flex, Text, Space } from '@/components/common/Wrapper';
import { media } from '@/styles';
import styled from '@emotion/styled';

Expand Down Expand Up @@ -47,8 +47,8 @@ export function PaymentsSuccess() {
}, [searchParams]);

return (
<Wrapper direction="column" gap="lg" justify="start">
<Flex direction="column" justify="space-between">
<Wrapper direction="column" justify="space-between">
<Flex direction="column" gap="lg">
<Heading typo="h1" color="black">
회비 결제 완료
</Heading>
Expand All @@ -57,7 +57,10 @@ export function PaymentsSuccess() {
<Text>이제 GDSC 정회원으로 이번 학기에 활동하실 수 있어요!</Text>
</Flex>
</Flex>
<Button onClick={() => navigate(RoutePath.Dashboard)}>완료하기</Button>
<Flex direction="column">
<Button onClick={() => navigate(RoutePath.Dashboard)}>완료하기</Button>
<Space height={28} />
</Flex>
</Wrapper>
);
}
Expand Down
Loading