Skip to content

Commit

Permalink
feat(campaign): show announcements
Browse files Browse the repository at this point in the history
  • Loading branch information
gary02 committed Aug 19, 2024
1 parent c048621 commit 0a989c9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/definitions/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export type CampaignDetail = CampaignDigest & {
application: GQLCampaignApplication
}[]
}
announcements: Array<ArticleDigest>
articles: Connection<ArticleDigest>
}

Expand Down
3 changes: 3 additions & 0 deletions src/gql/fragments/campaign/detail.gql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ fragment CampaignDetail on WritingChallenge {
end
}
}
announcements {
...ArticleDigest
}
participants(input: { first: null, oss: true }) {
edges {
application {
Expand Down
29 changes: 15 additions & 14 deletions src/pages/CampaignDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ class CampaignDetail extends React.Component<CampaignDetailChildProps> {
<DateTime date={campaign.writingPeriod?.end} dateOnly />
</Description>

<Description term="活動公告">
<a href={campaign.link} target="_blank" rel="noreferrer">
{campaign.link}
</a>
</Description>

<Description term="站內連結">
<a
href={`${SITE_DOMIAN}/e/${campaign.shortHash}`}
Expand All @@ -98,29 +92,36 @@ class CampaignDetail extends React.Component<CampaignDetailChildProps> {
<Cover cover={campaign.cover} />
</Description>
</DescriptionList>

<DescriptionList size="large" title="活動公告">
<Description term="规则公告連結">
<a href={campaign.link} target="_blank" rel="noreferrer">
{campaign.link}
</a>
</Description>

<Col span={24} style={{ marginBottom: 16 }}>
<ArticleDigestList data={campaign.announcements} />
</Col>
</DescriptionList>
<Divider size="large" />

<DescriptionList size="large" title="投稿選項" col={1}>
<Table bordered dataSource={campaign.stages}>
<ColumnGroup title="繁">
<Column title="名稱" dataIndex="name" key="name" width="5" />
<Column title="名稱" dataIndex="name" key="name" />
<Column title="簡介" dataIndex="description" key="description" />
</ColumnGroup>
<ColumnGroup title="英">
<Column title="名稱" dataIndex="nameEn" key="nameEn" width="5" />
<Column title="名稱" dataIndex="nameEn" key="nameEn" />
<Column
title="簡介"
dataIndex="descriptionEn"
key="descriptionEn"
/>
</ColumnGroup>
<ColumnGroup title="簡">
<Column
title="名稱"
dataIndex="nameZhHans"
key="nameZhHans"
width="5"
/>
<Column title="名稱" dataIndex="nameZhHans" key="nameZhHans" />
<Column
title="簡介"
dataIndex="descriptionZhHans"
Expand Down

0 comments on commit 0a989c9

Please sign in to comment.