From 0da696222585727b6c3a12c9391092560cd9146a Mon Sep 17 00:00:00 2001 From: CoCo-Japan-pan Date: Sun, 15 Oct 2023 17:08:36 +0900 Subject: [PATCH] modify filter func --- .../src/pages/ListPage/SmallTable.tsx | 4 ++-- atcoder-problems-frontend/src/pages/ListPage/index.tsx | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/atcoder-problems-frontend/src/pages/ListPage/SmallTable.tsx b/atcoder-problems-frontend/src/pages/ListPage/SmallTable.tsx index 314b0e59d..1f75b8753 100755 --- a/atcoder-problems-frontend/src/pages/ListPage/SmallTable.tsx +++ b/atcoder-problems-frontend/src/pages/ListPage/SmallTable.tsx @@ -10,7 +10,7 @@ import { useMergedProblemMap } from "../../api/APIClient"; interface Props { submissions: Submission[]; - setFilterFunc: (point: number) => void; + setFilterFunc: (from: number, to: number) => void; } export const getTotalCount = ( @@ -95,7 +95,7 @@ export const SmallTable: React.FC = ({ submissions, setFilterFunc }) => { setFilterFunc(point)} + onClick={(): void => setFilterFunc(point, point + 99)} > {`${point}-`} diff --git a/atcoder-problems-frontend/src/pages/ListPage/index.tsx b/atcoder-problems-frontend/src/pages/ListPage/index.tsx index e888c75bd..15ce5233d 100755 --- a/atcoder-problems-frontend/src/pages/ListPage/index.tsx +++ b/atcoder-problems-frontend/src/pages/ListPage/index.tsx @@ -25,12 +25,13 @@ export const ListPage: React.FC = (props) => { const submissions = useMultipleUserSubmissions(users).data ?? []; const progressReset = useProgressResetList().data; - const setExactPointFilter = (point: number): void => { + const setPointFilter = (from: number, to: number): void => { const params = new URLSearchParams(location.search); - params.set(FilterParams.FromPoint, point.toString()); - params.set(FilterParams.ToPoint, point.toString()); + params.set(FilterParams.FromPoint, from.toString()); + params.set(FilterParams.ToPoint, to.toString()); history.push({ ...location, search: params.toString() }); }; + const setDifficultyFilter = (from: number, to: number): void => { const params = new URLSearchParams(location.search); params.set(FilterParams.FromDifficulty, from.toString()); @@ -53,7 +54,7 @@ export const ListPage: React.FC = (props) => {