Skip to content

Commit 6211b52

Browse files
committed
fix(web): finish merging dev
1 parent 1596088 commit 6211b52

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

web/src/components/CasesDisplay/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const StyledHR = styled.hr`
1010
`;
1111

1212
interface ICasesDisplay extends ICasesGrid {
13+
numberDisputes?: number;
1314
numberClosedDisputes?: number;
1415
title?: string;
1516
className?: string;
@@ -39,7 +40,6 @@ const CasesDisplay: React.FC<ICasesDisplay> = ({
3940
<CasesGrid
4041
disputes={disputes}
4142
{...{
42-
numberDisputes,
4343
casesPerPage,
4444
totalPages,
4545
currentPage,

web/src/components/DisputeCard/DisputeInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from "react";
22
import styled, { css } from "styled-components";
3-
import { useFiltersContext } from "context/FilterProvider";
43
import { Periods } from "consts/periods";
54
import BookmarkIcon from "svgs/icons/bookmark.svg";
65
import CalendarIcon from "svgs/icons/calendar.svg";
76
import LawBalanceIcon from "svgs/icons/law-balance.svg";
87
import PileCoinsIcon from "svgs/icons/pile-coins.svg";
98
import RoundIcon from "svgs/icons/round.svg";
109
import Field from "../Field";
10+
import { useLocalStorage } from "react-use";
1111

1212
const Container = styled.div<{ isList: boolean }>`
1313
display: flex;
@@ -56,7 +56,7 @@ const formatDate = (date: number) => {
5656
};
5757

5858
const DisputeInfo: React.FC<IDisputeInfo> = ({ courtId, court, category, rewards, period, date, round }) => {
59-
const { isList } = useFiltersContext();
59+
const [isList, _] = useLocalStorage<boolean>("isList", false);
6060

6161
return (
6262
<Container isList={isList}>

web/src/pages/Cases/CasesFetcher.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from "react";
2+
import { useWindowSize } from "react-use";
23
import { useParams, useNavigate } from "react-router-dom";
34
import { DisputeDetailsFragment, Dispute_Filter, OrderDirection } from "src/graphql/graphql";
4-
import CasesDisplay from "components/CasesDisplay";
5+
import { BREAKPOINT_LANDSCAPE } from "styles/landscapeStyle";
56
import { useCasesQuery } from "queries/useCasesQuery";
67
import { useCounterQuery, CounterQuery } from "queries/useCounter";
78
import { useCourtDetails, CourtDetailsQuery } from "queries/useCourtDetails";
89
import { decodeURIFilter, useRootPath } from "utils/uri";
10+
import CasesDisplay from "components/CasesDisplay";
911
import { isUndefined } from "utils/index";
1012

1113
const calculateStats = (
@@ -40,7 +42,9 @@ const CasesFetcher: React.FC = () => {
4042
const { page, order, filter } = useParams();
4143
const location = useRootPath();
4244
const navigate = useNavigate();
43-
const casesPerPage = 3;
45+
const { width } = useWindowSize();
46+
const screenIsBig = width > BREAKPOINT_LANDSCAPE;
47+
const casesPerPage = screenIsBig ? 9 : 3;
4448
const pageNumber = parseInt(page ?? "1");
4549
const disputeSkip = casesPerPage * (pageNumber - 1);
4650
const { data: counterData } = useCounterQuery();
@@ -49,6 +53,7 @@ const CasesFetcher: React.FC = () => {
4953
const { data: courtData } = useCourtDetails(decodedFilter?.court?.toString());
5054
const { data } = useCasesQuery(
5155
disputeSkip,
56+
casesPerPage,
5257
decodedFilter,
5358
order === "asc" ? OrderDirection.Asc : OrderDirection.Desc
5459
);

0 commit comments

Comments
 (0)