Skip to content

Commit 5b87de3

Browse files
committed
refact: 발송 예약 메일과 미발송 예약 메일로 UI 변경
1 parent 627e4c4 commit 5b87de3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/pages/dashboard/ui/mail/MailBoxPage.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import { mailInfo } from '../../../../shared/types/mailInfoType';
77
import EmailDeleteMoal from '../../../../widgets/dashboard/ui/EmailDeleteModal';
88

99
const 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}

0 commit comments

Comments
 (0)