-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
メインページに終了後・開催中・予定されたコンテストおよびユーザーのランキングの表示をした (#261)
* 予定されたコンテストのAPI作成 close #1 * 開催中のコンテスト一覧実装 close #1 * 終了したコンテスト一覧を取得できるようにした close #1 * メインページにランキング追加 close #1 * LatestContestsInfo -> ContestInfoList
- Loading branch information
Showing
9 changed files
with
415 additions
and
26,522 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { VFC } from 'react'; | ||
import Table from 'react-bootstrap/Table'; | ||
import { Link } from 'react-router-dom'; | ||
import { ContestInfo } from '../types'; | ||
|
||
type Props = { contests: ContestInfo[] | null }; | ||
|
||
export const ContestTable: VFC<Props> = ({ contests }) => { | ||
return ( | ||
<> | ||
<Table bordered hover size="sm" striped> | ||
<thead> | ||
<tr> | ||
<th className="text-center">開始時刻</th> | ||
<th className="text-center">コンテスト名</th> | ||
<th className="text-center">種類</th> | ||
<th className="text-center">時間</th> | ||
<th className="text-center">Rated対象</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{contests?.map((contest) => ( | ||
<tr key={contest.id}> | ||
<td className="text-center">{contest.startTimeAMPM}</td> | ||
<td> | ||
<Link to={`/contest/${contest.id}`}>{contest.name}</Link> | ||
</td> | ||
<td className="text-center">{contest.contestType}</td> | ||
<td className="text-center"> | ||
{Math.floor( | ||
(contest.unixEndTime - contest.unixStartTime) / (60 * 1000) | ||
)} | ||
分 | ||
</td> | ||
<td className="text-center"> | ||
{contest.ratedBound > 0 ? `~ ${contest.ratedBound - 1}` : '-'} | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</Table> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters