Skip to content

Commit 161611e

Browse files
committed
fix(web): feedback by plinio implementation
1 parent acb94e9 commit 161611e

File tree

8 files changed

+43
-39
lines changed

8 files changed

+43
-39
lines changed

web/src/components/CasesDisplay/CasesGrid.tsx

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
11
import React from "react";
2-
import styled, { css } from "styled-components";
2+
import styled from "styled-components";
33
import { StandardPagination } from "@kleros/ui-components-library";
4-
import { landscapeStyle } from "styles/landscapeStyle";
54
import { useFiltersContext } from "context/FilterProvider";
65
import { CasesPageQuery } from "queries/useCasesQuery";
76
import DisputeCard from "components/DisputeCard";
87
import 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+
3217
const ListContainer = styled.div`
3318
display: flex;
3419
flex-direction: column;
@@ -52,13 +37,10 @@ export interface ICasesGrid {
5237

5338
const 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
})}

web/src/components/DisputeCard/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ import { isUndefined } from "utils/index";
1616
import { useVotingHistory } from "hooks/queries/useVotingHistory";
1717

1818
const StyledCard = styled(Card)`
19-
width: 312px;
19+
width: 100%;
2020
height: 260px;
2121
${landscapeStyle(
2222
() =>
2323
css`
24-
width: 380px;
24+
/* Explanation of this formula:
25+
- The 48px accounts for the total width of gaps: 2 gaps * 24px each.
26+
- The 0.333 is used to equally distribute width among 3 cards per row.
27+
- The 294px ensures the card has a minimum width.
28+
*/
29+
width: max(calc((100% - 48px) * 0.333), 294px);
2530
`
2631
)}
2732
`;
33+
2834
const StyledListItem = styled(Card)`
2935
display: flex;
3036
flex-grow: 1;

web/src/components/Popup/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const Container = styled.div`
5252
flex-direction: column;
5353
align-items: center;
5454
justify-content: center;
55-
width: calc(300px + (600 - 300) * (100vw - 375px) / (1250 - 375));
55+
width: 82vw;
5656
max-width: 600px;
5757
border-radius: 3px;
5858
border: 1px solid ${({ theme }) => theme.stroke};
@@ -66,6 +66,7 @@ const Container = styled.div`
6666
${landscapeStyle(
6767
() => css`
6868
overflow-y: hidden;
69+
width: calc(300px + (600 - 300) * (100vw - 375px) / (1250 - 375));
6970
`
7071
)}
7172
`;

web/src/layout/Header/navbar/DappList.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ const Header = styled.h1`
2525
const Container = styled.div`
2626
display: flex;
2727
position: absolute;
28-
max-height: 80vh;
28+
max-height: 340px;
2929
top: 5%;
3030
left: 50%;
3131
transform: translate(-50%);
3232
z-index: 1;
3333
flex-direction: column;
3434
align-items: center;
3535
36-
width: calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375));
36+
width: 82%;
3737
max-width: 480px;
3838
min-width: 300px;
3939
border-radius: 3px;
@@ -52,6 +52,8 @@ const Container = styled.div`
5252
left: 0;
5353
right: auto;
5454
transform: none;
55+
width: calc(300px + (480 - 300) * (100vw - 375px) / (1250 - 375));
56+
max-height: 80vh;
5557
`
5658
)}
5759
`;

web/src/layout/Header/navbar/Menu/Help.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const Container = styled.div`
1515
position: absolute;
1616
max-height: 80vh;
1717
overflow-y: auto;
18-
width: auto;
18+
width: 82%;
19+
max-width: 444px;
1920
top: 5%;
2021
left: 50%;
2122
transform: translateX(-50%);

web/src/layout/Header/navbar/Menu/Settings/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const Container = styled.div`
1111
position: absolute;
1212
max-height: 80vh;
1313
overflow-y: auto;
14-
z-index: 1;
1514
background-color: ${({ theme }) => theme.whiteBackground};
1615
flex-direction: column;
1716
top: 5%;
@@ -44,7 +43,14 @@ const StyledSettingsText = styled.div`
4443

4544
const StyledTabs = styled(Tabs)`
4645
padding: 0 calc(8px + (32 - 8) * ((100vw - 300px) / (1250 - 300)));
47-
width: calc(300px + (424 - 300) * ((100vw - 300px) / (1250 - 300)));
46+
width: 82vw;
47+
max-width: 660px;
48+
49+
${landscapeStyle(
50+
() => css`
51+
width: calc(300px + (424 - 300) * ((100vw - 300px) / (1250 - 300)));
52+
`
53+
)}
4854
`;
4955

5056
const TABS = [

web/src/pages/Home/LatestCases.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ import { StyledSkeleton } from "components/StyledSkeleton";
77

88
const Container = styled.div`
99
margin-top: calc(64px + (80 - 64) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
10-
.disputes-container {
11-
display: flex;
12-
gap: 24px;
13-
flex-wrap: wrap;
14-
justify-content: center;
15-
}
1610
1711
h1 {
1812
margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
1913
}
2014
`;
2115

16+
const DisputesContainer = styled.div`
17+
display: flex;
18+
gap: 24px;
19+
flex-wrap: wrap;
20+
justify-content: center;
21+
`;
22+
2223
const LatestCases: React.FC = () => {
2324
const { data } = useCasesQuery(0);
2425
const { setIsList } = useFiltersContext();
@@ -30,11 +31,11 @@ const LatestCases: React.FC = () => {
3031
return (
3132
<Container>
3233
<h1>Latest Cases</h1>
33-
<div className="disputes-container">
34+
<DisputesContainer>
3435
{data
3536
? data.disputes.map((dispute) => <DisputeCard key={dispute.id} {...dispute} />)
3637
: Array.from({ length: 3 }).map((_, index) => <StyledSkeleton key={index} width={312} height={260} />)}
37-
</div>
38+
</DisputesContainer>
3839
</Container>
3940
);
4041
};

web/src/styles/global-style.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export const GlobalStyle = createGlobalStyle`
6060
color: ${({ theme }) => theme.primaryText};
6161
}
6262
63+
textarea {
64+
font-family: "Open Sans";
65+
font-size: 14px;
66+
}
67+
6368
small {
6469
font-weight: 600;
6570
font-size: 14px;

0 commit comments

Comments
 (0)