diff --git a/src/api/hooks/useTeam.ts b/src/api/hooks/useTeam.ts index a8593c2..941946d 100644 --- a/src/api/hooks/useTeam.ts +++ b/src/api/hooks/useTeam.ts @@ -5,7 +5,7 @@ import { useQueryClient, UseMutationResult, } from "@tanstack/react-query"; -import { AxiosResponse, AxiosError } from "axios"; +import axios, { AxiosResponse, AxiosError } from "axios"; import { apiClient } from "@/api/instance"; import { Team, @@ -43,6 +43,21 @@ export const useDeleteTeam = () => { onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["teams"] }); }, + onError: (error) => { + console.error("팀 삭제 오류:", error); + if (axios.isAxiosError(error) && error.response) { + if (error.response.status === 404) { + alert("해당 팀을 찾을 수 없습니다."); + } else if (error.response.status === 403) { + alert("팀 삭제 권한이 없습니다."); + } else { + alert("팀 삭제 중 오류가 발생했습니다. 다시 시도해 주세요."); + } + } else { + alert("네트워크 오류가 발생했습니다. 인터넷 연결을 확인해 주세요."); + } + }, + }); }; @@ -54,7 +69,7 @@ export const useLeaveTeam = () => { mutationFn: async (teamId: number) => { const confirmed = window.confirm("정말로 팀에서 나가시겠습니까?"); if (!confirmed) { - return; // 사용자가 취소를 누른 경우, 요청을 중단 + return; } await apiClient.delete(`/api/teams/${teamId}/leave`); }, diff --git a/src/api/hooks/useUserData.ts b/src/api/hooks/useUserData.ts index 5838009..5b29017 100644 --- a/src/api/hooks/useUserData.ts +++ b/src/api/hooks/useUserData.ts @@ -1,6 +1,7 @@ import { useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { apiClient } from "@/api/instance"; +import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; const useUserData = () => { const [userData, setUserData] = useState({ @@ -34,7 +35,7 @@ const useUserData = () => { const handleSubscription = () => { apiClient - .post("/api/subscription/me/payment", { + .post("/api/subscription/me/subscribe", { type: "MONTHLY", }) .then(() => { @@ -43,6 +44,8 @@ const useUserData = () => { .catch((error) => console.error("error subscribtion:", error)); }; + + const handleDeleteAccount = () => { // 회원 탈퇴 API 호출 if (window.confirm("정말로 회원 탈퇴를 하시겠습니까?")) { @@ -52,7 +55,10 @@ const useUserData = () => { alert("회원 탈퇴가 완료되었습니다."); navigate("/"); }) - .catch((error) => console.error("Error deleting account:", error)); + .catch((error) => { + console.error("Error deleting account:", error); + alert("회원 탈퇴 중 오류가 발생했습니다. 다시 시도해 주세요."); + }); } }; diff --git a/src/components/features/CustomCalendar/CustomCalendar.styles.ts b/src/components/features/CustomCalendar/CustomCalendar.styles.ts index fda8ec8..06238d7 100644 --- a/src/components/features/CustomCalendar/CustomCalendar.styles.ts +++ b/src/components/features/CustomCalendar/CustomCalendar.styles.ts @@ -188,6 +188,12 @@ export const eventItemStyles = (status: string, isDragging: boolean) => css` `} `; +// 제목용 +export const eventItemTitleStyles = css` + font-size: 0.9rem; /* 원하는 크기로 조정 */ + font-weight: bold; +`; + export const dropdownMenuStyles = css` position: absolute; top: 100%; diff --git a/src/components/features/CustomCalendar/CustomCalendar.tsx b/src/components/features/CustomCalendar/CustomCalendar.tsx index c4417fb..b7dc370 100644 --- a/src/components/features/CustomCalendar/CustomCalendar.tsx +++ b/src/components/features/CustomCalendar/CustomCalendar.tsx @@ -23,6 +23,7 @@ import { eventItemStyles, dropdownItemStyles, dropdownMenuStyles, + eventItemTitleStyles, } from "./CustomCalendar.styles"; import useDeletePlan from "@/api/hooks/useDeletePlan"; import Modal from "@/components/common/Modal/Modal"; @@ -97,9 +98,10 @@ const VIEW_MODES = { const calculateEventStatus = (event: CalendarEvent) => { const now = new Date(); + const nowKST = new Date(now.getTime() + (9 * 60 * 60 * 1000)); if (event.isCompleted) return "completed"; - if (event.start > now) return "upcoming"; - if (!event.isCompleted && event.end < now) return "incomplete"; + if (event.start > nowKST) return "upcoming"; + if (!event.isCompleted && event.end < nowKST) return "incomplete"; return "incomplete"; }; @@ -308,7 +310,7 @@ const EventContent = ({ style={{ position: "relative", cursor: "pointer" }} >
{timeText}
-
{event.title}
+
{event.title}
{isDropdownOpen && createPortal(DropdownMenu, document.body)} diff --git a/src/pages/Friend/FriendPage.tsx b/src/pages/Friend/FriendPage.tsx index a816d95..fd34496 100644 --- a/src/pages/Friend/FriendPage.tsx +++ b/src/pages/Friend/FriendPage.tsx @@ -142,18 +142,24 @@ const SearchButton = styled.span` `; const FriendListContainer = styled.div` + grid-template-columns: 1fr 1fr; width: 100%; - display: grid; - gap: 16px; - box-sizing: border-box; - grid-template-columns: 1fr; - - @media (min-width: ${breakpoints.lg}px) { - grid-template-columns: 1fr 1fr; + display: grid; + box-sizing: border-box; + gap:16px; + ${breakpoints.tablet} { + grid-template-columns: 1fr; + width: 100%; + display: grid; + box-sizing: border-box; } ${breakpoints.mobile} { gap: 12px; + width: 100%; + display: grid; + box-sizing: border-box; + grid-template-columns: 1fr; } `; diff --git a/src/pages/Landing/LandingPage.tsx b/src/pages/Landing/LandingPage.tsx index c7584c4..09ccb6e 100644 --- a/src/pages/Landing/LandingPage.tsx +++ b/src/pages/Landing/LandingPage.tsx @@ -191,8 +191,9 @@ const Card = styled(motion.div)` flex-direction: column; @media (min-width: 768px) { - width: 70%; + width: 100%; padding: 2rem; + } `;