Skip to content

Commit 0da6962

Browse files
modify filter func
1 parent 684c72e commit 0da6962

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

atcoder-problems-frontend/src/pages/ListPage/SmallTable.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useMergedProblemMap } from "../../api/APIClient";
1010

1111
interface Props {
1212
submissions: Submission[];
13-
setFilterFunc: (point: number) => void;
13+
setFilterFunc: (from: number, to: number) => void;
1414
}
1515

1616
export const getTotalCount = (
@@ -95,7 +95,7 @@ export const SmallTable: React.FC<Props> = ({ submissions, setFilterFunc }) => {
9595
<th key={point}>
9696
<a
9797
href={window.location.hash}
98-
onClick={(): void => setFilterFunc(point)}
98+
onClick={(): void => setFilterFunc(point, point + 99)}
9999
>
100100
{`${point}-`}
101101
</a>

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ export const ListPage: React.FC<Props> = (props) => {
2525
const submissions = useMultipleUserSubmissions(users).data ?? [];
2626
const progressReset = useProgressResetList().data;
2727

28-
const setExactPointFilter = (point: number): void => {
28+
const setPointFilter = (from: number, to: number): void => {
2929
const params = new URLSearchParams(location.search);
30-
params.set(FilterParams.FromPoint, point.toString());
31-
params.set(FilterParams.ToPoint, point.toString());
30+
params.set(FilterParams.FromPoint, from.toString());
31+
params.set(FilterParams.ToPoint, to.toString());
3232
history.push({ ...location, search: params.toString() });
3333
};
34+
3435
const setDifficultyFilter = (from: number, to: number): void => {
3536
const params = new URLSearchParams(location.search);
3637
params.set(FilterParams.FromDifficulty, from.toString());
@@ -53,7 +54,7 @@ export const ListPage: React.FC<Props> = (props) => {
5354
<Row>
5455
<SmallTable
5556
submissions={filteredSubmissions}
56-
setFilterFunc={setExactPointFilter}
57+
setFilterFunc={setPointFilter}
5758
/>
5859
</Row>
5960

0 commit comments

Comments
 (0)