File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/pages/dashboard/ui/mail Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,11 @@ import { mailInfo } from '../../../../shared/types/mailInfoType';
77import EmailDeleteMoal from '../../../../widgets/dashboard/ui/EmailDeleteModal' ;
88
99const MailBoxPage = ( ) => {
10- const [ listType , setListType ] = useState < 'all ' | 'pending' > ( 'all ' ) ;
10+ const [ listType , setListType ] = useState < 'completed ' | 'pending' > ( 'completed ' ) ;
1111 const [ isModalOpen , setIsModalOpen ] = useState ( false ) ;
1212 const currentDate = new Date ( ) ;
1313
14+ const completedMails = mailInfo . filter ( mail => new Date ( mail . date ) < currentDate ) ;
1415 const pendingMails = mailInfo . filter ( mail => new Date ( mail . date ) > currentDate ) ;
1516
1617 return (
@@ -22,17 +23,17 @@ const MailBoxPage = () => {
2223 </ div >
2324 < div className = "flex gap-3 font-semibold text-15" >
2425 < TextButton
25- label = "모든 메일"
26- onClick = { ( ) => setListType ( 'all ' ) }
27- className = { listType === 'all ' ? 'text-main' : '' }
26+ label = "발송 예약 메일"
27+ onClick = { ( ) => setListType ( 'completed ' ) }
28+ className = { listType === 'completed ' ? 'text-main' : '' }
2829 />
2930 < TextButton
3031 label = "미발송 예약 메일"
3132 onClick = { ( ) => setListType ( 'pending' ) }
3233 className = { listType === 'pending' ? 'text-main' : '' }
3334 />
3435 </ div >
35- { ( listType === 'all ' ? mailInfo : pendingMails ) . map ( mail => (
36+ { ( listType === 'completed ' ? completedMails : pendingMails ) . map ( mail => (
3637 < SentMailCard
3738 key = { mail . id }
3839 mail = { mail }
You can’t perform that action at this time.
0 commit comments