+
diff --git a/src/components/home/manualMatching/MyMatchingPage.tsx b/src/components/home/manualMatching/MyMatchingPage.tsx
index 2c3de85..c9d4dc0 100644
--- a/src/components/home/manualMatching/MyMatchingPage.tsx
+++ b/src/components/home/manualMatching/MyMatchingPage.tsx
@@ -22,18 +22,22 @@ const MyMatchingPage = ({ isOpen }: { isOpen: boolean }) => {
참여중인 매칭 리스트를 확인할 수 있어요!
- {myMatchingList.length > 0 ? (
- myMatchingList.map((myInfo) => {
- return
;
- })
- ) : (
-
매칭 내역이 없어요!
- )}
+ <>
+ {myMatchingList.length > 0 ? (
+ myMatchingList.map((myInfo) => {
+ return (
+
+ );
+ })
+ ) : (
+
매칭 내역이 없어요!
+ )}
+
+ >
{isFetchingNextPage && (
)}
-
>
);
};
diff --git a/src/components/home/manualMatching/matchingInfoItem/index.tsx b/src/components/home/manualMatching/matchingInfoItem/index.tsx
index 0ef9720..ef49e8d 100644
--- a/src/components/home/manualMatching/matchingInfoItem/index.tsx
+++ b/src/components/home/manualMatching/matchingInfoItem/index.tsx
@@ -5,10 +5,12 @@ import MatchingComplete from '@/components/modal/MatchingComplete';
import { useModal } from '@/contexts/ModalContext';
import { useToast } from '@/contexts/ToastContext';
import joinManualMatchingRoom from '@/libs/apis/manual/joinManualMatchingRoom.api';
+import formatToKoreanTime from '@/utils/formatToKoreanTIme';
import axios from 'axios';
import { motion } from 'framer-motion';
import { Room } from 'gachTaxi-types';
import { useState } from 'react';
+import { useNavigate } from 'react-router-dom';
interface MatchingInfoItem {
manualInfo: Room;
@@ -25,6 +27,7 @@ const MatchingInfoItem = ({
const animateState = isExpand ? 'expanded' : 'collapsed';
const { openModal } = useModal();
const { openToast } = useToast();
+ const navigate = useNavigate();
const handleJoinMatching = async () => {
try {
@@ -44,6 +47,10 @@ const MatchingInfoItem = ({
}
};
+ const handleJoinChatting = () => {
+ navigate(`/chat/${manualInfo.chattingRoomId}`);
+ };
+
return (
<>
- {manualInfo.departureTime}
+ {formatToKoreanTime(manualInfo.departureTime)}
{manualInfo.currentMembers}/4
@@ -88,16 +95,29 @@ const MatchingInfoItem = ({
)}
-
+ {manualInfo.tags.length > 0 ? (
+
+ ) : (
+
+ - 등록된 태그가 없어요!
+
+ )}
- {isExpand && currentPage! && (
+
+ {isExpand && (
)}
diff --git a/src/components/modal/AgreementModal.tsx b/src/components/modal/AgreementModal.tsx
index 13b1e83..1503c28 100644
--- a/src/components/modal/AgreementModal.tsx
+++ b/src/components/modal/AgreementModal.tsx
@@ -14,6 +14,7 @@ import requestAgreement from '@/libs/apis/auth/requestAgreement';
import { useToast } from '@/contexts/ToastContext';
import handleAxiosError from '@/libs/apis/axiosError.api';
import useRequestStatus from '@/hooks/useRequestStatus';
+import ERROR_MESSAGE from '@/constants/errorMessage.constant';
const AgreementModal = () => {
const navigate = useNavigate();
@@ -60,7 +61,8 @@ const AgreementModal = () => {
} catch (error: unknown) {
setError();
const errorMessage = handleAxiosError(error);
- openToast(errorMessage, 'error');
+ console.error(errorMessage);
+ openToast(ERROR_MESSAGE, 'error');
} finally {
closeModal();
}
diff --git a/src/components/modal/FriendDeleteOrBlack.tsx b/src/components/modal/FriendDeleteOrBlack.tsx
index 75a53ec..2e92904 100644
--- a/src/components/modal/FriendDeleteOrBlack.tsx
+++ b/src/components/modal/FriendDeleteOrBlack.tsx
@@ -1,5 +1,6 @@
import Button from '@/components/commons/Button';
import Modal from '@/components/modal';
+import ERROR_MESSAGE from '@/constants/errorMessage.constant';
import { useModal } from '@/contexts/ModalContext';
import { useToast } from '@/contexts/ToastContext';
import useDeleteFriend from '@/hooks/mutations/useDeleteFriend';
@@ -24,8 +25,8 @@ const FriendDeleteOrBlack = ({
closeModal();
setCurrentPage('BLACK_LIST');
},
- onError: (error) => {
- openToast(error.message, 'error');
+ onError: () => {
+ openToast(ERROR_MESSAGE, 'error');
},
});
};
@@ -37,8 +38,8 @@ const FriendDeleteOrBlack = ({
closeModal();
setCurrentPage('FRIEND_LIST');
},
- onError: (error) => {
- openToast(error.message, 'error');
+ onError: () => {
+ openToast(ERROR_MESSAGE, 'error');
},
});
};
diff --git a/src/components/notification/FriendRequestNotification.tsx b/src/components/notification/FriendRequestNotification.tsx
index d5bfa85..1dd5768 100644
--- a/src/components/notification/FriendRequestNotification.tsx
+++ b/src/components/notification/FriendRequestNotification.tsx
@@ -1,8 +1,9 @@
import Button from '@/components/commons/Button';
+import ERROR_MESSAGE from '@/constants/errorMessage.constant';
import { useToast } from '@/contexts/ToastContext';
-import useAcceptFriend from '@/hooks/mutations/useAcceptFriend';
-import useDeleteFriend from '@/hooks/mutations/useDeleteFriend';
import useDeleteNotification from '@/hooks/mutations/useDeleteNotification';
+import useFriendReply from '@/hooks/mutations/useFriendReply';
+import useInviteReply from '@/hooks/mutations/useInviteReply';
import { NotificationResponse } from '@gachTaxi-types';
import { InfiniteData, useQueryClient } from '@tanstack/react-query';
import { motion } from 'framer-motion';
@@ -10,18 +11,22 @@ import { motion } from 'framer-motion';
interface FriendRequestNotificationProps {
senderId: number;
content: string;
+ matchingRoomId: number;
notificationId: string;
+ type: 'FRIEND_REQUEST' | 'MATCH_INVITE';
}
const FriendRequestNotification = ({
senderId,
content,
+ matchingRoomId,
notificationId,
+ type,
}: FriendRequestNotificationProps) => {
const { openToast } = useToast();
const { mutate: deleteNotification } = useDeleteNotification();
- const { mutate: acceptFriend } = useAcceptFriend();
- const { mutate: rejectFriend } = useDeleteFriend();
+ const { mutate: replyFriend } = useFriendReply();
+ const { mutate: replyInite } = useInviteReply();
const queryClient = useQueryClient();
// 낙관적 업데이트용 함수
@@ -43,12 +48,17 @@ const FriendRequestNotification = ({
const acceptFriendRequest = () => {
handleQueryData();
- acceptFriend(senderId, {
+ const data = {
+ memberId: senderId,
+ notificationId,
+ status: 'ACCEPTED' as const,
+ };
+ replyFriend(data, {
onSuccess: (response) => {
openToast(response.message, 'success');
},
- onError: (error) => {
- openToast(error.message, 'error');
+ onError: () => {
+ openToast(ERROR_MESSAGE, 'error');
},
});
};
@@ -60,8 +70,36 @@ const FriendRequestNotification = ({
onSuccess: (response) => {
openToast(response.message, 'success');
},
- onError: (error) => {
- openToast(error.message, 'error');
+ onError: () => {
+ openToast(ERROR_MESSAGE, 'error');
+ },
+ });
+ };
+
+ const handleAcceptInvite = () => {
+ handleQueryData();
+
+ const data = { matchingRoomId, notificationId, status: 'ACCEPT' as const };
+ replyInite(data, {
+ onSuccess: (response) => {
+ openToast(response.message, 'success');
+ },
+ onError: () => {
+ openToast(ERROR_MESSAGE, 'error');
+ },
+ });
+ };
+
+ const handleRejectInvite = () => {
+ handleQueryData();
+
+ const data = { matchingRoomId, notificationId, status: 'REJECT' as const };
+ replyInite(data, {
+ onSuccess: (response) => {
+ openToast(response.message, 'success');
+ },
+ onError: () => {
+ openToast(ERROR_MESSAGE, 'error');
},
});
};
@@ -69,12 +107,17 @@ const FriendRequestNotification = ({
const rejectFriendRequest = () => {
handleQueryData();
- rejectFriend(senderId, {
+ const data = {
+ memberId: senderId,
+ notificationId,
+ status: 'REJECTED' as const,
+ };
+ replyFriend(data, {
onSuccess: (response) => {
openToast(response.message, 'success');
},
- onError: (error) => {
- openToast(error.message, 'error');
+ onError: () => {
+ openToast(ERROR_MESSAGE, 'error');
},
});
};
@@ -103,13 +146,20 @@ const FriendRequestNotification = ({
>
{content}
-
}>
diff --git a/src/pages/manual-register/index.tsx b/src/pages/manual-register/index.tsx
index 319be39..a81db36 100644
--- a/src/pages/manual-register/index.tsx
+++ b/src/pages/manual-register/index.tsx
@@ -18,9 +18,11 @@ import { formatTimeToSelect } from '@/utils';
import TimeSelect from '@/components/manual-register/timeSelect';
import { useToast } from '@/contexts/ToastContext';
import { useNavigate } from 'react-router-dom';
+import SpinnerIcon from '@/assets/icon/spinnerIcon.svg?react';
import useSheetStore from '@/store/useSheetStore';
import createManualMatchingRoom from '@/libs/apis/manual/createManualMatchingRoom.api';
import axios from 'axios';
+import { Suspense } from 'react';
const ManualMatchingRegister = () => {
const manualMatchingForm = useForm
>({
@@ -31,7 +33,7 @@ const ManualMatchingRegister = () => {
time: formatTimeToSelect(new Date(new Date().setHours(1, 0, 0, 0))),
members: [],
criteria: [],
- content: '',
+ description: '',
expectedTotalCharge: 4800,
},
});
@@ -90,7 +92,15 @@ const ManualMatchingRegister = () => {
)}
/>
-
+
+
+
+ }
+ >
+