@@ -53,10 +53,11 @@ export default function CampaignsSection() {
5353 let isMounted = true ;
5454 const fetchData = async ( ) => {
5555 try {
56- const res =
57- await axiosInstance . get < CollaborationResponse > ( "/api/v1/campaigns/collaborations/me" ) ;
56+ const res = await axiosInstance . get < CollaborationResponse > (
57+ "/api/v1/campaigns/collaborations/me" ,
58+ ) ;
5859 if ( ! isMounted ) return ;
59- setItems ( res . data ?. isSuccess ? res . data . result ?? [ ] : [ ] ) ;
60+ setItems ( res . data ?. isSuccess ? ( res . data . result ?? [ ] ) : [ ] ) ;
6061 } catch ( error ) {
6162 console . error ( "캠페인 조회 실패:" , error ) ;
6263 if ( ! isMounted ) return ;
@@ -79,15 +80,18 @@ export default function CampaignsSection() {
7980 } , [ items , safePage ] ) ;
8081
8182 const pageNumbers = useMemo ( ( ) => {
82- if ( totalPages <= 4 ) return Array . from ( { length : totalPages } , ( _ , i ) => i + 1 ) ;
83+ if ( totalPages <= 4 )
84+ return Array . from ( { length : totalPages } , ( _ , i ) => i + 1 ) ;
8385 const start = Math . max ( 1 , Math . min ( safePage - 1 , totalPages - 3 ) ) ;
8486 return [ start , start + 1 , start + 2 , start + 3 ] ;
8587 } , [ safePage , totalPages ] ) ;
8688
8789 return (
8890 < section className = "py-6" >
8991 < div className = "flex items-center justify-between mb-[12px]" >
90- < div className = "text-[16px] leading-[20px] font-semibold text-black/80" > 진행한 캠페인</ div >
92+ < div className = "text-[14px] leading-[20px] font-semibold text-black/80" >
93+ 진행한 캠페인
94+ </ div >
9195 < button
9296 type = "button"
9397 onClick = { ( ) => setIsOpen ( ( prev ) => ! prev ) }
@@ -117,9 +121,15 @@ export default function CampaignsSection() {
117121 < div className = "divide-y divide-[#E8E8FB]" >
118122 { pageItems . map ( ( item , idx ) => {
119123 const typeLabel = item . type ? typeLabelMap [ item . type ] : "" ;
120- const statusLabel = item . status ? statusLabelMap [ item . status ] : "" ;
121- const dateLabel = formatDate ( item . endDate ?? item . startDate ?? undefined ) ;
122- const rightLabel = [ dateLabel , statusLabel ] . filter ( Boolean ) . join ( " " ) ;
124+ const statusLabel = item . status
125+ ? statusLabelMap [ item . status ]
126+ : "" ;
127+ const dateLabel = formatDate (
128+ item . endDate ?? item . startDate ?? undefined ,
129+ ) ;
130+ const rightLabel = [ dateLabel , statusLabel ]
131+ . filter ( Boolean )
132+ . join ( " " ) ;
123133 const title = item . title ?? "" ;
124134 const brand = item . brandName ? `${ item . brandName } - ` : "" ;
125135
@@ -162,10 +172,19 @@ export default function CampaignsSection() {
162172 disabled = { safePage === 1 }
163173 aria-label = "이전 페이지"
164174 >
165- < svg width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
166- < path d = "M17 6L11.5 12L17 18" stroke = "#5B5D6B" strokeWidth = "1.5" />
175+ < svg
176+ width = "24"
177+ height = "24"
178+ viewBox = "0 0 24 24"
179+ fill = "none"
180+ xmlns = "http://www.w3.org/2000/svg"
181+ >
182+ < path
183+ d = "M17 6L11.5 12L17 18"
184+ stroke = "#5B5D6B"
185+ strokeWidth = "1.5"
186+ />
167187 </ svg >
168-
169188 </ button >
170189
171190 { pageNumbers . map ( ( n ) => (
@@ -189,10 +208,19 @@ export default function CampaignsSection() {
189208 disabled = { safePage === totalPages }
190209 aria-label = "다음 페이지"
191210 >
192- < svg width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
193- < path d = "M7 18L12.5 12L7 6" stroke = "#5B5D6B" strokeWidth = "1.5" />
211+ < svg
212+ width = "24"
213+ height = "24"
214+ viewBox = "0 0 24 24"
215+ fill = "none"
216+ xmlns = "http://www.w3.org/2000/svg"
217+ >
218+ < path
219+ d = "M7 18L12.5 12L7 6"
220+ stroke = "#5B5D6B"
221+ strokeWidth = "1.5"
222+ />
194223 </ svg >
195-
196224 </ button >
197225 < button
198226 type = "button"
@@ -201,11 +229,24 @@ export default function CampaignsSection() {
201229 disabled = { safePage === totalPages }
202230 aria-label = "마지막 페이지"
203231 >
204- < svg width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
205- < path d = "M7 18L12.5 12L7 6" stroke = "#5B5D6B" strokeWidth = "1.5" />
206- < path d = "M13 18L18.5 12L13 6" stroke = "#5B5D6B" strokeWidth = "1.5" />
232+ < svg
233+ width = "24"
234+ height = "24"
235+ viewBox = "0 0 24 24"
236+ fill = "none"
237+ xmlns = "http://www.w3.org/2000/svg"
238+ >
239+ < path
240+ d = "M7 18L12.5 12L7 6"
241+ stroke = "#5B5D6B"
242+ strokeWidth = "1.5"
243+ />
244+ < path
245+ d = "M13 18L18.5 12L13 6"
246+ stroke = "#5B5D6B"
247+ strokeWidth = "1.5"
248+ />
207249 </ svg >
208-
209250 </ button >
210251 </ div >
211252 </ div >
0 commit comments