Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions src/pages/TablePage/TableTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { Row, ButtonGroup, Button } from 'reactstrap';

export enum ContestTableTab {
'regular' = 0,
'long' = 1,
'other' = 2,
'other_problems' = 3,
'all' = 4,
'other' = 1,
'other_problems' = 2,
'all' = 3,
}

interface Props {
Expand All @@ -26,16 +25,7 @@ export const TableTabButtons: React.FC<Props> = (props) => {
}}
active={active === ContestTableTab.regular}
>
yukicoder contest (regular)
</Button>
<Button
color="secondary"
onClick={() => {
setActive(ContestTableTab.long);
}}
active={active === ContestTableTab.long}
>
yukicoder contest (long)
yukicoder contest
</Button>
<Button
color="secondary"
Expand Down
26 changes: 6 additions & 20 deletions src/pages/TablePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,15 @@ export const TablePage: React.FC = () => {
ContestTableTab.regular
);

const yukicoderRegularContests = [] as Contest[];
const yukicoderLongContests = [] as Contest[];
const yukicoderContests = [] as Contest[];
const otherContests = [] as Contest[];
const otherProblems = [] as Contest[];
const regexpYukicoderContest = /^yukicoder contest \d+/;
const regexpYukicoderContest = /^\s*yukicoder\s+contest\s+\d+/;
const regexpOpenContest = /\(Open\)$/;
contests.forEach((contest) => {
if (regexpYukicoderContest.exec(contest.Name)) {
if (contest.ProblemIdList.length <= 7)
yukicoderRegularContests.push(contest);
else yukicoderLongContests.push(contest);
if (contest.ProblemIdList.length <= 8) yukicoderContests.push(contest);
else otherContests.push(contest);
} else if (regexpOpenContest.exec(contest.Name)) {
otherProblems.push(contest);
} else otherContests.push(contest);
Expand Down Expand Up @@ -286,20 +284,8 @@ export const TablePage: React.FC = () => {
<DifficultyStarsFillDefs />
<ContestWrapper display={activeTab === ContestTableTab.regular}>
<YukicoderRegularTable
contests={yukicoderRegularContests}
title="yukicoder contest (regular)"
mergedProblemsMap={mergedProblemsMap}
showDifficultyLevel={showDifficultyLevel}
problemLinkColorMode={colorMode}
showContestResult={showContestResult}
showContestDate={showContestDate}
universalStateLoaded={universalStateLoaded}
/>
</ContestWrapper>
<ContestWrapper display={activeTab === ContestTableTab.long}>
<ContestTable
contests={yukicoderLongContests}
title="yukicoder contest (long)"
contests={yukicoderContests}
title="yukicoder contest"
mergedProblemsMap={mergedProblemsMap}
showDifficultyLevel={showDifficultyLevel}
problemLinkColorMode={colorMode}
Expand Down