Skip to content

Commit d3a54c7

Browse files
committed
fix: dashboard layout
1 parent 673c60a commit d3a54c7

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

web/src/components/CasesDisplay/CasesGrid.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@ import { useFiltersContext } from "context/FilterProvider";
66
import { CasesPageQuery } from "queries/useCasesQuery";
77
import DisputeCard from "components/DisputeCard";
88
import CasesListHeader from "./CasesListHeader";
9+
import { useLocation } from "react-router-dom";
910

10-
const GridContainer = styled.div`
11+
const GridContainer = styled.div<{ path: string }>`
1112
display: flex;
1213
flex-wrap: wrap;
1314
justify-content: center;
1415
align-items: center;
1516
gap: 8px;
16-
align-items: center;
17-
justify-items: center;
18-
${landscapeStyle(css`
19-
display: grid;
20-
row-gap: 16px;
21-
column-gap: 8px;
22-
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
23-
justify-content: space-between;
24-
`)}
17+
${(props) =>
18+
props.path === "/dashboard"
19+
? landscapeStyle(css`
20+
display: flex;
21+
`)
22+
: landscapeStyle(css`
23+
display: grid;
24+
row-gap: 16px;
25+
column-gap: 8px;
26+
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
27+
justify-content: space-between;
28+
`)}
2529
`;
2630
const ListContainer = styled.div`
2731
display: flex;
@@ -46,10 +50,13 @@ export interface ICasesGrid {
4650

4751
const CasesGrid: React.FC<ICasesGrid> = ({ disputes, currentPage, setCurrentPage, numberDisputes, casesPerPage }) => {
4852
const { isList } = useFiltersContext();
53+
const location = useLocation();
54+
55+
const path = location.pathname;
4956
return (
5057
<>
5158
{!isList ? (
52-
<GridContainer>
59+
<GridContainer path={path}>
5360
{disputes.map((dispute) => {
5461
return <DisputeCard key={dispute?.id} {...dispute} />;
5562
})}

0 commit comments

Comments
 (0)