diff --git a/src/components/Card/AnnounceCard/index.tsx b/src/components/Card/AnnounceCard/index.tsx index 42346fbd..2762352c 100644 --- a/src/components/Card/AnnounceCard/index.tsx +++ b/src/components/Card/AnnounceCard/index.tsx @@ -6,26 +6,36 @@ import openLink from '@utils/router/openLink'; interface AnnounceCardProps extends AnnounceItem { author?: string; + recruitment_period?: string; } const AnnounceCard = ({ title, link, uploadDate, + recruitment_period, author, }: AnnounceCardProps) => { const { major } = useMajor(); - uploadDate = uploadDate.slice(2); + const showDate = () => { + if (recruitment_period) return recruitment_period; + uploadDate = uploadDate.slice(2); + return `20${uploadDate}`; + }; return ( openLink(link)} data-testid="card"> {title} - 20{uploadDate} - - {author ? author : major} + {showDate()} + {!recruitment_period && ( + <> + + {author ? author : major} + + )} diff --git a/src/pages/Announcement/index.tsx b/src/pages/Announcement/index.tsx index 1bc072b1..b9a8344b 100644 --- a/src/pages/Announcement/index.tsx +++ b/src/pages/Announcement/index.tsx @@ -44,6 +44,16 @@ const Announcement = () => { /> } /> + + } + /> ); };