Skip to content

Commit

Permalink
Merge pull request #307 from GDSC-PKNU-Official/feat/#306
Browse files Browse the repository at this point in the history
Feat/#306: 채용공지사항 기능 추가
  • Loading branch information
pp449 authored Jan 7, 2024
2 parents f64d6c3 + efaaf43 commit 7e2221c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/Card/AnnounceCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Card onClick={() => openLink(link)} data-testid="card">
<ContentContainer>
<AnnounceTitle>{title}</AnnounceTitle>
<SubContent>
<AnnounceDate>20{uploadDate}</AnnounceDate>
<VertialBoundaryLine />
<Source>{author ? author : major}</Source>
<AnnounceDate>{showDate()}</AnnounceDate>
{!recruitment_period && (
<>
<VertialBoundaryLine />
<Source>{author ? author : major}</Source>
</>
)}
</SubContent>
</ContentContainer>
<HorizonBoundaryLine />
Expand Down
10 changes: 10 additions & 0 deletions src/pages/Announcement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ const Announcement = () => {
/>
}
/>
<Route
path={PATH.RECRUIT_ANNOUNCEMENT}
element={
<AnnounceContainer
title={ANNOUNCEMENT_TITLE.RECRUIT}
category={ANNOUNCEMENT_CATEGORY.RECRUIT}
endPoint={'/recruit'}
/>
}
/>
</Routes>
);
};
Expand Down

0 comments on commit 7e2221c

Please sign in to comment.