Skip to content

Commit 61c67b6

Browse files
committed
chore(web): remove unused context
1 parent 36608f3 commit 61c67b6

File tree

2 files changed

+7
-81
lines changed

2 files changed

+7
-81
lines changed

web/src/components/CasesDisplay/CasesGrid.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from "react";
22
import styled from "styled-components";
3+
import { useParams } from "react-router-dom";
34
import Skeleton from "react-loading-skeleton";
45
import { StandardPagination } from "@kleros/ui-components-library";
56
import { isUndefined } from "utils/index";
7+
import { decodeURIFilter } from "utils/uri";
68
import { DisputeDetailsFragment } from "queries/useCasesQuery";
7-
import { useFiltersContext } from "context/FilterProvider";
89
import DisputeCard from "components/DisputeCard";
910

1011
const Container = styled.div`
@@ -43,7 +44,9 @@ const CasesGrid: React.FC<ICasesGrid> = ({
4344
currentPage,
4445
setCurrentPage,
4546
}) => {
46-
const { debouncedSearch } = useFiltersContext();
47+
const { filter } = useParams();
48+
const decodedFilter = decodeURIFilter(filter ?? "all");
49+
const { id: searchValue } = decodedFilter;
4750

4851
return (
4952
<>
@@ -57,13 +60,13 @@ const CasesGrid: React.FC<ICasesGrid> = ({
5760
</Container>
5861
)}
5962

60-
{debouncedSearch === "" && (
63+
{isUndefined(searchValue) ? (
6164
<StyledPagination
6265
currentPage={currentPage}
6366
numPages={Math.ceil(totalPages ?? 0)}
6467
callback={(page: number) => setCurrentPage(page)}
6568
/>
66-
)}
69+
) : null}
6770
</>
6871
);
6972
};

web/src/context/FilterProvider.tsx

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)