@@ -6,6 +6,8 @@ import { apiRoutes } from "@/api/apiRoutes";
66import axiosInstance from "@/api/axiosInstance" ;
77import { Invite } from "@/types/invite" ;
88import useUserStore from "@/store/useUserStore" ;
9+ import { ToastContainer , toast } from "react-toastify" ;
10+ import "react-toastify/dist/ReactToastify.css" ;
911
1012const ITEMS_PER_PAGE = 6 ; // 한 번에 보여줄 개수
1113
@@ -65,11 +67,13 @@ function InvitedList({
6567 payload
6668 ) ;
6769 console . log ( "대시보드 수락 성공:" , response . data ) ;
68- alert ( "대시보드 수락 성공" ) ; // 추후에 toast로 변경
69- window . location . reload ( ) ;
70+ toast . success ( "대시보드 수락 성공" ) ;
71+ setTimeout ( ( ) => {
72+ window . location . reload ( ) ;
73+ } , 100 ) ;
7074 } catch ( error ) {
7175 console . error ( "대시보드 수락 실패:" , error ) ;
72- alert ( "대시보드 수락 실패" ) ; // 추후에 toast로 변경
76+ toast . error ( "대시보드 수락 실패" ) ;
7377 }
7478 } ;
7579
@@ -85,16 +89,19 @@ function InvitedList({
8589 payload
8690 ) ;
8791 console . log ( "대시보드 거절 성공:" , response . data ) ;
88- alert ( "대시보드 거절 성공" ) ; // 추후에 toast로 변경
89- window . location . reload ( ) ;
92+ toast . success ( "대시보드 거절 성공" ) ;
93+ setTimeout ( ( ) => {
94+ window . location . reload ( ) ;
95+ } , 100 ) ;
9096 } catch ( error ) {
9197 console . error ( "대시보드 거절 실패:" , error ) ;
92- alert ( "대시보드 거절 실패" ) ; // 추후에 toast로 변경
98+ toast . error ( "대시보드 거절 실패" ) ;
9399 }
94100 } ;
95101
96102 return (
97103 < div className = "relative bg-white w-[260px] sm:w-[504px] lg:w-[1022px] h-[770px] sm:h-[592px] lg:h-[620px] mx-auto mt-[40px]" >
104+ < ToastContainer position = "top-center" autoClose = { 2000 } />
98105 { filteredData . length > 0 && (
99106 < div className = "hidden sm:flex p-6 w-full h-[26px] justify-start items-center pl-[43px] pr-[76px] md:gap-x-[130px] lg:gap-x-[280px]" >
100107 < p className = "lg:ml-10 font-normal text-[var(--color-gray2)]" > 이름</ p >
@@ -165,13 +172,11 @@ function InvitedList({
165172 : ! hasMore && < NoResultDashBoard searchTitle = { searchTitle } /> } { " " }
166173 { /* 검색 내역이 없을 경우 */ }
167174 { filteredData . length > 0 && ! hasMore && (
168- < p className = "lg:mr-18 text-center text-gray-400 py-4 " >
175+ < p className = "lg:mr-18 text-center text-gray-400 bg-transparent " >
169176 더 이상 초대 목록이 없습니다.
170177 </ p >
171178 ) }
172- { hasMore && (
173- < div ref = { observerRef } className = "h-[50px] w-[50px] bg-red" > </ div >
174- ) }
179+ { hasMore && < div ref = { observerRef } className = "h-[50px] w-[50px]" > </ div > }
175180 </ div >
176181 </ div >
177182 ) ;
0 commit comments