diff --git a/src/app/features/dashboard_Id/components/EditColumnModal.tsx b/src/app/features/dashboard_Id/components/EditColumnModal.tsx index 02bca26..9c8c98d 100644 --- a/src/app/features/dashboard_Id/components/EditColumnModal.tsx +++ b/src/app/features/dashboard_Id/components/EditColumnModal.tsx @@ -158,7 +158,7 @@ export default function EditColumnModal() { @@ -167,7 +167,7 @@ export default function EditColumnModal() { - + <> + {/* 데스크톱/태블릿 테이블 레이아웃 */} +
+ {/* 대시보드 이름 */} + + {invitation.dashboard.title || '제목 없음'} + + + {/* 초대자 */} + + {invitation.inviter.nickname || invitation.inviter.email} + + + {/* 수락/거절 버튼들 */} +
+ + +
+
+ + {/* 모바일 카드 레이아웃 */} +
+ {/* 이름 */} +
+ 이름 + + {invitation.dashboard.title || '제목 없음'} + +
+ + {/* 초대자 */} +
+ 초대자 + + {invitation.inviter.nickname || invitation.inviter.email} + +
+ + {/* 버튼들 */} +
+ + +
- + ) } diff --git a/src/app/mydashboard/components/InvitedDashboardTable/InvitedDashboardTable.tsx b/src/app/mydashboard/components/InvitedDashboardTable/InvitedDashboardTable.tsx index 36539ca..1638477 100644 --- a/src/app/mydashboard/components/InvitedDashboardTable/InvitedDashboardTable.tsx +++ b/src/app/mydashboard/components/InvitedDashboardTable/InvitedDashboardTable.tsx @@ -50,10 +50,10 @@ export default function InvitedDashboardTable() { return (
{/* 검색창 스켈레톤 */} -
+
{/* 테이블 헤더 */} -
+
이름 초대자 @@ -67,7 +67,7 @@ export default function InvitedDashboardTable() { {Array.from({ length: 3 }).map((_, index) => (
@@ -82,10 +82,10 @@ export default function InvitedDashboardTable() { if (isError) { return (
-

+

초대받은 대시보드를 불러오는 중 오류가 발생했습니다.

-

+

{error?.message || '다시 시도해주세요.'}

@@ -96,7 +96,7 @@ export default function InvitedDashboardTable() { if (allInvitations.length === 0) { return (
-
+
초대받은 대시보드 없음
-

+

아직 초대받은 대시보드가 없어요.

@@ -117,8 +117,8 @@ export default function InvitedDashboardTable() { {/* 검색창 */} - {/* 테이블 헤더 */} -
+ {/* 테이블 헤더 - 모바일에서 숨김 */} +
이름 초대자 @@ -129,11 +129,11 @@ export default function InvitedDashboardTable() {
{/* 테이블 바디 */} -
+
{searchQuery.trim() && filteredInvitations.length === 0 ? ( // 검색 결과 없음
-

+

`{searchQuery}`에 대한 검색 결과가 없습니다.

@@ -155,7 +155,7 @@ export default function InvitedDashboardTable() { {/* 더 이상 데이터가 없을 때 */} {!hasNextPage && allInvitations.length > 0 && (
-

+

모든 초대를 확인했습니다.

diff --git a/src/app/mydashboard/components/InvitedDashboardTable/SearchInput.tsx b/src/app/mydashboard/components/InvitedDashboardTable/SearchInput.tsx index fd88d38..57027dc 100644 --- a/src/app/mydashboard/components/InvitedDashboardTable/SearchInput.tsx +++ b/src/app/mydashboard/components/InvitedDashboardTable/SearchInput.tsx @@ -14,13 +14,13 @@ export default function SearchInput({ placeholder = '검색', }: SearchInputProps) { return ( -
+
onChange(e.target.value)} - className="Border-btn h-40 w-full rounded-8 border pl-40 pr-12 text-14 placeholder-gray-400 focus:border-blue-500 focus:outline-none" + className="Border-btn mobile:h-36 mobile:text-14 mobile:placeholder:text-14 h-40 w-full rounded-8 border pl-40 pr-12 text-14 placeholder-gray-400 focus:border-blue-500 focus:outline-none" />
새로운 대시보드 diff --git a/src/app/mydashboard/components/MyDashboardGrid/MyDashboardCard.tsx b/src/app/mydashboard/components/MyDashboardGrid/MyDashboardCard.tsx index 0d3b984..30b3012 100644 --- a/src/app/mydashboard/components/MyDashboardGrid/MyDashboardCard.tsx +++ b/src/app/mydashboard/components/MyDashboardGrid/MyDashboardCard.tsx @@ -19,7 +19,7 @@ export default function MyDashboardCard({ dashboard }: MyDashboardCardProps) { return (
@@ -30,7 +30,7 @@ export default function MyDashboardCard({ dashboard }: MyDashboardCardProps) { /> {/* 대시보드 제목 */} -

+

{dashboard.title}

diff --git a/src/app/mydashboard/components/MyDashboardGrid/MyDashboardGrid.tsx b/src/app/mydashboard/components/MyDashboardGrid/MyDashboardGrid.tsx index 72d167a..d6c9ad0 100644 --- a/src/app/mydashboard/components/MyDashboardGrid/MyDashboardGrid.tsx +++ b/src/app/mydashboard/components/MyDashboardGrid/MyDashboardGrid.tsx @@ -22,7 +22,7 @@ export default function MyDashboardGrid() { if (isLoading) { return (
-
+
{/* 새 대시보드 추가 버튼은 항상 표시 */} @@ -30,7 +30,7 @@ export default function MyDashboardGrid() { {Array.from({ length: 5 }).map((_, index) => (
))}
@@ -61,7 +61,7 @@ export default function MyDashboardGrid() { return (
-
+
{/* 새 대시보드 추가 카드는 항상 첫 번째 고정 */} @@ -76,7 +76,7 @@ export default function MyDashboardGrid() { {/* 페이지네이션 */} {totalPages > 1 && ( -
+
{currentPage} 페이지 중 {totalPages} diff --git a/src/app/mydashboard/page.tsx b/src/app/mydashboard/page.tsx index b572f56..0311ade 100644 --- a/src/app/mydashboard/page.tsx +++ b/src/app/mydashboard/page.tsx @@ -13,17 +13,17 @@ export default function MyDashboardPage() { {/* 메인 */} -
+
{/* 헤더 */}
{/* 페이지 콘텐츠 */} -
+
{/* 초대받은 대시보드 섹션 */} -
-

+
+

초대받은 대시보드

diff --git a/src/app/shared/components/common/modal/CreateDashboardModal.tsx b/src/app/shared/components/common/modal/CreateDashboardModal.tsx index 7e26ccc..798a75c 100644 --- a/src/app/shared/components/common/modal/CreateDashboardModal.tsx +++ b/src/app/shared/components/common/modal/CreateDashboardModal.tsx @@ -1,6 +1,7 @@ 'use client' import { useModalStore } from '@store/useModalStore' +import { useQueryClient } from '@tanstack/react-query' import React, { useEffect } from 'react' import { useDashboardForm } from '@/app/shared/hooks/useDashboardForm' @@ -8,6 +9,7 @@ import { useDashboardForm } from '@/app/shared/hooks/useDashboardForm' import DashboardForm from '../../dashboard/DashboardForm' export default function CreateDashboardModal() { + const queryClient = useQueryClient() const { modalType, closeModal } = useModalStore() const isModalOpen = modalType === 'createDashboard' @@ -29,6 +31,24 @@ export default function CreateDashboardModal() { if (!isModalOpen) return null + // 쿼리 무효화 포함한 제출 핸들러 + const handleSubmitWithInvalidation = async ( + e: React.FormEvent, + ) => { + // 원래 handleSubmit 실행 + await handleSubmit(e) + + // 사이드바 무한스크롤 쿼리 무효화 + queryClient.invalidateQueries({ + queryKey: ['dashboards', 'infinite'], + }) + + // 내 대시보드 페이지 쿼리 무효화 + queryClient.invalidateQueries({ + queryKey: ['myDashboards'], + }) + } + const handleBackdropClick = (e: React.MouseEvent) => { if (e.target === e.currentTarget) { closeModal() @@ -47,7 +67,7 @@ export default function CreateDashboardModal() { onChange={handleChange} onColorSelect={handleColorSelect} onSubmit={(e) => { - handleSubmit(e) + handleSubmitWithInvalidation(e) closeModal() }} isSubmitting={isSubmitting} diff --git a/src/app/shared/components/common/sidebar/DashboardItem.tsx b/src/app/shared/components/common/sidebar/DashboardItem.tsx index 25e10d8..42a788c 100644 --- a/src/app/shared/components/common/sidebar/DashboardItem.tsx +++ b/src/app/shared/components/common/sidebar/DashboardItem.tsx @@ -18,22 +18,22 @@ export default function DashboardItem({ type="button" aria-current={isActive ? 'page' : undefined} onClick={handleClick} - className={`Text-black flex w-full items-center gap-12 rounded-6 px-12 py-8 text-left text-18 transition-colors hover:bg-gray-50 ${ + className={`Text-black tablet:gap-8 tablet:px-8 tablet:py-6 tablet:text-16 mobile:justify-center mobile:px-4 mobile:py-6 BG-Input-hovered flex w-full items-center gap-12 rounded-6 px-12 py-8 text-left text-18 transition-colors ${ isActive ? 'BG-currentDashboard font-medium' : '' }`} > {/* 컬러 도트 */}
{/* 대시보드 제목 */} - {dashboard.title} + {dashboard.title} {/* 내가 만든 대시보드에 왕관 아이콘 */} {dashboard.createdByMe && ( -
+
내가 만든 대시보드 { + return data?.pages.flatMap((page) => page.dashboards) || [] + }, [data]) + const handleDashboardClick = (dashboard: Dashboard) => { - setSelectedDashboard(dashboard) // 선택한 대시보드를 전역 상태에 저장 + setSelectedDashboard(dashboard) router.push(`/dashboard/${dashboard.id}`) } - // 에러 타입 타입 불일치(jsx로 렌더링할 수 없음) 방지를 위한 string 처리 + // 에러 타입 처리 const errorMessage = error instanceof Error ? error.message : '대시보드 목록 불러오기 실패' return ( -