Skip to content

Commit

Permalink
feat: 比赛显示参赛人数
Browse files Browse the repository at this point in the history
  • Loading branch information
renbaoshuo committed Nov 23, 2024
1 parent e359d9a commit e77b345
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/contest/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ const Contest: React.FC = () => {
<h1>{contestName}</h1>
<p>
举办于 {contest.year} 年({contest.school_year()}-
{contest.school_year() + 1} 学年),共 {contest.contestants.length}{' '}
人获奖。
{contest.school_year() + 1} 学年),共{' '}
{contest.capacity ? `${contest.capacity} 人参赛、` : ''}
{contest.contestants.length} 人获奖。
</p>
<h4>获奖情况</h4>
<div style={{ height: 200 }}>
Expand Down
2 changes: 2 additions & 0 deletions src/pages/contest/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const Contests: React.FC = () => {
<Table.Row>
<Table.HeaderCell width={1}>#</Table.HeaderCell>
<Table.HeaderCell>名称</Table.HeaderCell>
<Table.HeaderCell width={2}>参赛人数</Table.HeaderCell>
<Table.HeaderCell width={2}>获奖人数</Table.HeaderCell>
</Table.Row>
</Table.Header>
Expand All @@ -38,6 +39,7 @@ const Contests: React.FC = () => {
{fixChineseSpace(fixContestName(contest.name))}
</Link>
</Table.Cell>
<Table.Cell>{contest.capacity ?? '-'}</Table.Cell>
<Table.Cell>{contest.contestants.length}</Table.Cell>
</Table.Row>
))}
Expand Down

0 comments on commit e77b345

Please sign in to comment.