11import React from "react" ;
2- import styled , { css } from "styled-components" ;
2+ import styled from "styled-components" ;
33import { StandardPagination } from "@kleros/ui-components-library" ;
4- import { landscapeStyle } from "styles/landscapeStyle" ;
54import { useFiltersContext } from "context/FilterProvider" ;
65import { CasesPageQuery } from "queries/useCasesQuery" ;
76import DisputeCard from "components/DisputeCard" ;
87import CasesListHeader from "./CasesListHeader" ;
9- import { useLocation } from "react-router-dom" ;
108
11- const GridContainer = styled . div < { path : string } > `
9+ const GridContainer = styled . div `
1210 display: flex;
1311 flex-wrap: wrap;
1412 justify-content: center;
1513 align-items: center;
16- gap: 8px;
17- ${ ( { path } ) =>
18- landscapeStyle ( ( ) =>
19- path === "/dashboard"
20- ? css `
21- display: flex;
22- `
23- : css `
24- display: grid;
25- row-gap: 16px;
26- column-gap: 8px;
27- grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
28- justify-content: space-between;
29- `
30- ) }
14+ gap: 24px;
3115` ;
16+
3217const ListContainer = styled . div `
3318 display: flex;
3419 flex-direction: column;
@@ -52,13 +37,10 @@ export interface ICasesGrid {
5237
5338const CasesGrid : React . FC < ICasesGrid > = ( { disputes, currentPage, setCurrentPage, numberDisputes, casesPerPage } ) => {
5439 const { isList } = useFiltersContext ( ) ;
55- const location = useLocation ( ) ;
56-
57- const path = location . pathname ;
5840 return (
5941 < >
6042 { ! isList ? (
61- < GridContainer path = { path } >
43+ < GridContainer >
6244 { disputes . map ( ( dispute ) => {
6345 return < DisputeCard key = { dispute ?. id } { ...dispute } /> ;
6446 } ) }
0 commit comments