11import { useState , useEffect , useRef , ChangeEvent } from "react" ;
2- import Image from "next/image" ;
32import NoResultDashBoard from "./NoResultDashBoard" ;
43import EmptyInvitations from "./EmptyInvitations" ;
54import { apiRoutes } from "@/api/apiRoutes" ;
65import axiosInstance from "@/api/axiosInstance" ;
76import { Invite } from "@/types/invite" ;
87import useUserStore from "@/store/useUserStore" ;
9- import { ToastContainer , toast } from "react-toastify" ;
10- import "react-toastify/dist/ReactToastify.css ";
8+ import { toast } from "react-toastify" ;
9+ import { Search } from "lucide-react ";
1110
1211const ITEMS_PER_PAGE = 6 ; // 한 번에 보여줄 개수
1312
@@ -96,14 +95,13 @@ function InvitedList({
9695 } ;
9796
9897 return (
99- < div className = "relative bg-white w-[260px] sm:w-[504px] lg:w-[1050px] h-[770px] sm:h-[592px] lg:h-[620px] mx-auto mt-[40px]" >
100- < ToastContainer position = "top-center" autoClose = { 2000 } />
98+ < div className = "relative bg-white w-full max-w-[260px] sm:max-w-[504px] lg:max-w-[966px] mx-auto mt-[40px]" >
10199 { filteredData . length > 0 && (
102- < 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] " >
100+ < div className = "hidden sm:grid grid-cols-3 px- 6 w-full h-[26px] justify-start items-center" >
103101 < p className = "lg:ml-10 font-normal text-[var(--color-gray2)]" > 이름</ p >
104102 < p className = "font-normal text-[var(--color-gray2)]" > 초대자</ p >
105103 < p className = "lg:ml-13 font-normal text-[var(--color-gray2)]" >
106- 수락여부
104+ 수락 여부
107105 </ p >
108106 </ div >
109107 ) }
@@ -112,20 +110,17 @@ function InvitedList({
112110 ? filteredData . map ( ( invite , index ) => (
113111 < div
114112 key = { index }
115- className = "pb-5 mb-[20px] w-[260px] sm:w-[504px] lg:w-[1050px] h-auto sm:h-[50px] sm:grid sm:grid-cols-[1fr_1fr_1fr] sm:items-center flex flex-col gap-10 border-b border-[var(--color-gray4)]"
113+ className = "pb-5 mb-[20px] w-full max-w-[260px] sm:max-w-[504px] lg:max-w-[966px] h-auto sm:h-[50px]
114+ sm:grid sm:grid-cols-[1fr_1fr_1fr] sm:items-center flex flex-col gap-10 border-b border-[var(--color-gray4)]"
116115 >
117116 { /* 모바일 레이아웃 */ }
118- < div className = "flex flex-col sm:hidden" >
119- < p className = "ml-9 mt-1 w-full" >
120- < span className = "mr-8 text-[var(--color-gray2)]" > 이름</ span >
121- < span className = "text-[#333236]" > { invite . title } </ span >
122- </ p >
123- < p className = "ml-9 mt-1 w-full" >
124- < span className = "mr-3.5 text-[var(--color-gray2)]" >
125- 초대자
126- </ span > { " " }
127- < span className = "text-[#333236]" > { invite . nickname } </ span >
128- </ p >
117+ < div className = "flex flex-col mt-1 sm:hidden" >
118+ < span className = "text-[var(--color-gray2)]" > 이름</ span >
119+ < span className = "text-[#333236]" > { invite . title } </ span >
120+ < span className = "mr-3.5 text-[var(--color-gray2)]" >
121+ 초대자
122+ </ span > { " " }
123+ < span className = "text-[#333236]" > { invite . nickname } </ span >
129124 < div className = "flex gap-2 mt-2 justify-center" >
130125 < button
131126 className = "cursor-pointer border px-3 py-1 rounded-md w-[84px] h-[32px] text-[var(--primary)] border-[var(--color-gray3)]"
@@ -267,35 +262,38 @@ export default function InvitedDashBoard() {
267262 { invitationArray . length === 0 ? (
268263 < EmptyInvitations />
269264 ) : (
270- < div className = "relative bg-white rounded-lg shadow-md w-[260px] sm:w-[504px] lg:w-[1050px] h-[770px] sm:h-[592px] lg:h-[620px] max-w-none" >
271- < div className = "p-6 relative w-full h-[104px]" >
272- < div className = "flex justify-between items-center mb-[32px]" >
273- < p className = "text-xl sm:text-2xl font-bold" > 초대받은 대시보드</ p >
274- </ div >
275- < div className = "relative w-[228px] sm:w-[448px] lg:w-[966px]" >
276- < input
277- id = "title"
278- placeholder = "검색"
279- type = "text"
280- value = { searchTitle }
281- onChange = { handleSearchInputChange }
282- className = "text-[var(--color-gray2)] w-full h-[40px] px-[40px] py-[6px] border border-[#D9D9D9] bg-white rounded-[6px] placeholder-gray-400 outline-none"
283- />
284- < Image
285- src = "/svgs/search.svg"
286- alt = "검색 아이콘"
287- width = { 20 }
288- height = { 20 }
289- className = "absolute left-[12px] top-1/2 transform -translate-y-1/2"
290- />
265+ < div className = "relative bg-white rounded-lg shadow-md w-[260px] sm:w-[504px] lg:w-[1022px] h-[770px] sm:h-[592px] lg:h-[620px] max-w-none" >
266+ < div className = "flex flex-col p-6 w-full h-[104px]" >
267+ < div className = "flex flex-col w-[228px] sm:w-[448px] lg:w-[966px] gap-[24px]" >
268+ < p className = "text-black3 text-xl sm:text-2xl font-bold" >
269+ 초대받은 대시보드
270+ </ p >
271+
272+ < div className = "relative w-[228px] sm:w-[448px] lg:w-[966px] mx-auto" >
273+ < input
274+ id = "title"
275+ placeholder = "검색"
276+ type = "text"
277+ value = { searchTitle }
278+ onChange = { handleSearchInputChange }
279+ className = "text-[var(--color-gray2)] w-full h-[40px] px-[40px] py-[6px] border border-[#D9D9D9] bg-white rounded-[6px] placeholder-gray-400 outline-none"
280+ />
281+ < Search
282+ width = { 18 }
283+ height = { 18 }
284+ color = "#333236"
285+ className = "absolute left-[12px] top-1/2 transform -translate-y-1/2"
286+ />
287+
288+ < InvitedList
289+ searchTitle = { searchTitle }
290+ invitationData = { invitationArray }
291+ fetchNextPage = { fetchNextPage }
292+ hasMore = { hasMore }
293+ />
294+ </ div >
291295 </ div >
292296 </ div >
293- < InvitedList
294- searchTitle = { searchTitle }
295- invitationData = { invitationArray }
296- fetchNextPage = { fetchNextPage }
297- hasMore = { hasMore }
298- />
299297 </ div >
300298 ) }
301299 </ div >
0 commit comments