Skip to content

Commit 1b61725

Browse files
変数名の修正
1 parent 1a3b961 commit 1b61725

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

atcoder-problems-frontend/src/pages/TablePage/Options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface Props {
3030
toggleLanguage: (language: string) => void;
3131
active: ContestCategory;
3232
mergeLikeContest: boolean;
33-
setMergeLikeContest: (showLikeContest: boolean) => void;
33+
setMergeLikeContest: (mergeLikeContest: boolean) => void;
3434
}
3535

3636
export const Options: React.FC<Props> = (props) => {

atcoder-problems-frontend/src/pages/TablePage/TableTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface Props {
1515
export const TableTabButtons: React.FC<Props> = (props) => {
1616
const { active, setActive, mergeLikeContest } = props;
1717

18-
const filterLikeContest = (contestCategories: readonly ContestCategory[]) => {
18+
const filterCategories = (contestCategories: readonly ContestCategory[]) => {
1919
if (!mergeLikeContest) return contestCategories;
2020

2121
return contestCategories.filter(
@@ -25,7 +25,7 @@ export const TableTabButtons: React.FC<Props> = (props) => {
2525
return (
2626
<Row>
2727
<ButtonGroup className="table-tab">
28-
{filterLikeContest(ContestCategories).map((category, i) => (
28+
{filterCategories(ContestCategories).map((category, i) => (
2929
<Button
3030
key={String(i)}
3131
color="secondary"

atcoder-problems-frontend/src/pages/TablePage/index.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
classifyContest,
2222
ContestCategory,
2323
} from "../../utils/ContestClassifier";
24-
import { getLikeContest } from "../../utils/LikeContestUtils";
24+
import { getLikeContestCategory } from "../../utils/LikeContestUtils";
2525
import { TableTabButtons } from "./TableTab";
2626
import { Options } from "./Options";
2727
import { ContestTable } from "./ContestTable";
@@ -59,9 +59,11 @@ export const TablePage: React.FC<OuterProps> = (props) => {
5959
);
6060
const [selectedLanguages, setSelectedLanguages] = useState(new Set<string>());
6161

62-
const selectedContests = [activeTab];
63-
const likeContest = getLikeContest(activeTab);
64-
if (likeContest && mergeLikeContest) selectedContests.push(likeContest);
62+
const selectedContestCategories = [activeTab];
63+
const likeContestCategory = getLikeContestCategory(activeTab);
64+
if (likeContestCategory && mergeLikeContest) {
65+
selectedContestCategories.push(likeContestCategory);
66+
}
6567

6668
const userRatingInfo = useRatingInfo(props.userId);
6769
const contestToProblems =
@@ -87,8 +89,9 @@ export const TablePage: React.FC<OuterProps> = (props) => {
8789
props.userId
8890
);
8991
const filteredContests =
90-
contests?.filter((c) => selectedContests.includes(classifyContest(c))) ??
91-
[];
92+
contests?.filter((c) =>
93+
selectedContestCategories.includes(classifyContest(c))
94+
) ?? [];
9295

9396
return (
9497
<div>

atcoder-problems-frontend/src/utils/LikeContestUtils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getLikeContest } from "./LikeContestUtils";
1+
import { getLikeContestCategory } from "./LikeContestUtils";
22
import { ContestCategory } from "./ContestClassifier";
33

44
type GetLikeContestTestType = [ContestCategory, ContestCategory | undefined];
@@ -17,5 +17,5 @@ test.each<GetLikeContestTestType>([
1717
["Other Sponsored", undefined],
1818
["Other Contests", undefined],
1919
])("Get Like Contest", (contest, result) => {
20-
expect(getLikeContest(contest)).toBe(result);
20+
expect(getLikeContestCategory(contest)).toBe(result);
2121
});

atcoder-problems-frontend/src/utils/LikeContestUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ContestCategory } from "./ContestClassifier";
22

3-
export const getLikeContest = (
3+
export const getLikeContestCategory = (
44
contestCategory: ContestCategory
55
): ContestCategory | undefined => {
66
switch (contestCategory) {

0 commit comments

Comments
 (0)