@@ -4,12 +4,13 @@ import { useState } from 'react';
44import EnvelopeImg from '@/assets/images/envelope.png' ;
55import BgItem from '@/assets/images/field-4.png' ;
66import PageTitle from '@/components/PageTitle' ;
7+ import ReportModal from '@/components/ReportModal' ;
78import Header from '@/layouts/Header' ;
89
910import Message from './components/Message' ;
1011import MessageDetailModal from './components/MessageDetailModal' ;
1112
12- const DUMMY_USER_ZIP_CODE = '12E12 ' ;
13+ const DUMMY_USER_ZIP_CODE = '22E12 ' ;
1314const DUMMY_TITLE = '침수 피해를 복구중인 포스코 임직원 분들에게 응원의 메시지를 보내주세요!' ;
1415const DUMMY_MESSAGE_COUNT = 20 ;
1516const DUMMY_MESSAGE = {
@@ -21,6 +22,16 @@ const DUMMY_MESSAGES = Array.from({ length: 10 }, () => ({ ...DUMMY_MESSAGE }));
2122
2223const RollingPaperPage = ( ) => {
2324 const [ activeMessageIndex , setActiveMessageIndex ] = useState < number | null > ( null ) ;
25+ const [ activeReportModal , setActiveReportModal ] = useState ( false ) ;
26+
27+ const handleReport = ( ) => {
28+ setActiveMessageIndex ( null ) ;
29+ setActiveReportModal ( true ) ;
30+ } ;
31+
32+ const handleDelete = ( ) => {
33+ setActiveMessageIndex ( null ) ;
34+ } ;
2435
2536 return (
2637 < >
@@ -29,12 +40,15 @@ const RollingPaperPage = () => {
2940 message = { DUMMY_MESSAGES [ activeMessageIndex ] }
3041 isWriter = { DUMMY_MESSAGES [ activeMessageIndex ] . sender === DUMMY_USER_ZIP_CODE }
3142 onClose = { ( ) => setActiveMessageIndex ( null ) }
43+ onReport = { handleReport }
44+ onDelete = { handleDelete }
3245 />
3346 ) }
47+ { activeReportModal && < ReportModal onClose = { ( ) => setActiveReportModal ( false ) } /> }
3448 < Header />
3549 < main className = "flex grow flex-col items-center px-5 pt-4 pb-12" >
3650 < PageTitle className = "mb-18 max-w-73 text-center" > { DUMMY_TITLE } </ PageTitle >
37- < p className = "body-sb text-gray-60 w-full" > 등록된 편지 { DUMMY_MESSAGE_COUNT } </ p >
51+ < p className = "body-sb text-gray-60 mb-2 w-full" > 등록된 편지 { DUMMY_MESSAGE_COUNT } </ p >
3852 < section className = "w-full" >
3953 < MasonryInfiniteGrid column = { 2 } align = "stretch" gap = { 16 } >
4054 { DUMMY_MESSAGES . map ( ( message , index ) => (
@@ -45,7 +59,7 @@ const RollingPaperPage = () => {
4559 < button type = "button" className = "fixed bottom-7.5 left-5 overflow-hidden rounded-sm" >
4660 < img src = { EnvelopeImg } alt = "편지지 이미지" className = "h-12 w-auto opacity-70" />
4761 < p className = "caption-sb absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 whitespace-nowrap text-white" >
48- 메시지 쓰기
62+ 편지 쓰기
4963 </ p >
5064 </ button >
5165 </ main >
0 commit comments