Skip to content

Commit fd9862b

Browse files
authored
Merge pull request #1305 from kleros/feat(web)/mobile-version-my-courts-dashboard
feat(web): style my courts (in dashboard) for desktop version
2 parents d4f554b + 25c969b commit fd9862b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2695
-262
lines changed

web/src/assets/svgs/mini-guides/appeal/crowdfund-appeal.svg

+10
Loading

web/src/assets/svgs/mini-guides/appeal/payoff-simulator.svg

+45
Loading

web/src/assets/svgs/mini-guides/appeal/stage-one.svg

+59
Loading

web/src/assets/svgs/mini-guides/appeal/stage-two.svg

+24
Loading

web/src/assets/svgs/mini-guides/binary-voting/voting-module.svg

+12
Loading

web/src/assets/svgs/mini-guides/onboarding/how-it-works.svg

+29
Loading

web/src/assets/svgs/mini-guides/onboarding/what-do-i-need.svg

+81
Loading

web/src/assets/svgs/mini-guides/ranked-voting/voting-module.svg

+66
Loading

web/src/assets/svgs/mini-guides/staking/court-header.svg

+107
Loading

web/src/assets/svgs/mini-guides/staking/juror-rewards.svg

+72
Loading

web/src/assets/svgs/mini-guides/staking/notifications.svg

+37
Loading

web/src/assets/svgs/mini-guides/staking/staking-section.svg

+39
Loading

web/src/assets/svgs/styled/pnk.svg

+5-5
Loading

web/src/components/CasesDisplay/Search.tsx

+27-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
import React, { useMemo, useState } from "react";
2+
import styled, { css } from "styled-components";
3+
import { landscapeStyle } from "styles/landscapeStyle";
24
import { useNavigate, useParams } from "react-router-dom";
35
import { useDebounce } from "react-use";
4-
import styled from "styled-components";
56
import Skeleton from "react-loading-skeleton";
67
import { Searchbar, DropdownCascader } from "@kleros/ui-components-library";
78
import { rootCourtToItems, useCourtTree } from "queries/useCourtTree";
89
import { isUndefined } from "utils/index";
910
import { decodeURIFilter, encodeURIFilter, useRootPath } from "utils/uri";
1011

1112
const Container = styled.div`
13+
display: flex;
14+
flex-direction: column;
15+
gap: 4px;
16+
17+
${landscapeStyle(
18+
() =>
19+
css`
20+
flex-direction: row;
21+
gap: calc(4px + (22 - 4) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
22+
`
23+
)}
24+
`;
25+
26+
const SearchBarContainer = styled.div`
27+
width: 100%;
1228
display: flex;
1329
flex-wrap: wrap;
1430
gap: 8px;
@@ -54,15 +70,7 @@ const Search: React.FC = () => {
5470
}, [courtTreeData]);
5571

5672
return (
57-
<div>
58-
<Container>
59-
<StyledSearchbar
60-
type="text"
61-
placeholder="Search By ID"
62-
value={search}
63-
onChange={(e) => setSearch(e.target.value)}
64-
/>
65-
</Container>
73+
<Container>
6674
{items ? (
6775
<DropdownCascader
6876
items={items}
@@ -76,7 +84,15 @@ const Search: React.FC = () => {
7684
) : (
7785
<Skeleton width={240} height={42} />
7886
)}
79-
</div>
87+
<SearchBarContainer>
88+
<StyledSearchbar
89+
type="text"
90+
placeholder="Search By ID"
91+
value={search}
92+
onChange={(e) => setSearch(e.target.value)}
93+
/>
94+
</SearchBarContainer>
95+
</Container>
8096
);
8197
};
8298

web/src/components/CasesDisplay/Stats.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ const FieldWrapper = styled.div`
77
`;
88

99
const SeparatorLabel = styled.label`
10-
margin-left: 8px;
11-
margin-right: 8px;
10+
margin: 0 8px;
11+
color: ${({ theme }) => theme.primaryText};
12+
`;
13+
14+
const StyledLabel = styled.label`
15+
color: ${({ theme }) => theme.primaryText};
1216
`;
1317

1418
const Field: React.FC<{ label: string; value: string }> = ({ label, value }) => (
1519
<FieldWrapper>
16-
<label>{label}</label>
20+
<StyledLabel>{label}</StyledLabel>
1721
<small>{value}</small>
1822
</FieldWrapper>
1923
);

web/src/components/CasesDisplay/StatsAndFilters.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const Container = styled.div`
77
display: flex;
88
flex-wrap: wrap;
99
gap: 8px;
10-
margin-top: 8px;
10+
margin-top: 11px;
11+
justify-content: space-between;
1112
`;
1213

1314
const StatsAndFilters: React.FC<IStats> = ({ totalDisputes, closedDisputes }) => (

web/src/components/CasesDisplay/index.tsx

+12-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ import Search from "./Search";
44
import StatsAndFilters from "./StatsAndFilters";
55
import CasesGrid, { ICasesGrid } from "./CasesGrid";
66

7-
const StyledHR = styled.hr`
8-
margin-top: 24px;
9-
margin-bottom: 24px;
7+
const Divider = styled.hr`
8+
display: flex;
9+
border: none;
10+
height: 1px;
11+
background-color: ${({ theme }) => theme.stroke};
12+
margin: calc(20px + (24 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875) 0;
13+
`;
14+
15+
const StyledTitle = styled.h1`
16+
margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
1017
`;
1118

1219
interface ICasesDisplay extends ICasesGrid {
@@ -29,10 +36,10 @@ const CasesDisplay: React.FC<ICasesDisplay> = ({
2936
}) => {
3037
return (
3138
<div {...{ className }}>
32-
<h1>{title}</h1>
39+
<StyledTitle>{title}</StyledTitle>
3340
<Search />
3441
<StatsAndFilters totalDisputes={numberDisputes ?? 0} closedDisputes={numberClosedDisputes ?? 0} />
35-
<StyledHR />
42+
<Divider />
3643

3744
{disputes?.length === 0 ? (
3845
<h1>No cases found</h1>

web/src/pages/Home/TopJurors/Header/HowItWorks.tsx web/src/components/HowItWorks.tsx

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import React from "react";
22
import styled from "styled-components";
3-
import { useToggle } from "react-use";
43
import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg";
5-
import Level from "components/Popup/MiniGuides/Level";
64

75
const Container = styled.div`
86
display: flex;
97
align-items: center;
108
gap: 8px;
9+
color: ${({ theme }) => theme.primaryBlue};
1110
1211
&,
1312
& * {
1413
cursor: pointer;
1514
}
1615
16+
&:hover {
17+
text-decoration: underline;
18+
}
19+
1720
svg {
1821
path {
1922
fill: ${({ theme }) => theme.primaryBlue};
@@ -25,15 +28,20 @@ const StyledLabel = styled.label`
2528
color: ${({ theme }) => theme.primaryBlue};
2629
`;
2730

28-
const HowItWorks: React.FC = () => {
29-
const [isLevelMiniGuidesOpen, toggleIsLevelMiniGuidesOpen] = useToggle(false);
31+
interface IHowItWorks {
32+
isMiniGuideOpen: boolean;
33+
toggleMiniGuide: () => void;
34+
MiniGuideComponent: React.ComponentType<{ toggleMiniGuide: () => void }>;
35+
}
36+
37+
const HowItWorks: React.FC<IHowItWorks> = ({ isMiniGuideOpen, toggleMiniGuide, MiniGuideComponent }) => {
3038
return (
3139
<>
32-
<Container onClick={() => toggleIsLevelMiniGuidesOpen()}>
40+
<Container onClick={toggleMiniGuide}>
3341
<BookOpenIcon />
3442
<StyledLabel> How it works </StyledLabel>
3543
</Container>
36-
{isLevelMiniGuidesOpen && <Level {...{ toggleIsLevelMiniGuidesOpen }} />}
44+
{isMiniGuideOpen && <MiniGuideComponent toggleMiniGuide={toggleMiniGuide} />}
3745
</>
3846
);
3947
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
import CrowdfundAppealSvg from "tsx:assets/svgs/mini-guides/appeal/crowdfund-appeal.svg";
4+
import { StyledImage } from "../PageContentsTemplate";
5+
6+
const StyledCrowdfundAppealSvg = styled(CrowdfundAppealSvg)`
7+
[class$="rect-bg"] {
8+
fill: ${({ theme }) => theme.whiteBackground};
9+
stroke: ${({ theme }) => theme.stroke};
10+
}
11+
12+
[class$="path-1"],
13+
[class$="path-2"],
14+
[class$="path-3"] {
15+
fill: ${({ theme }) => theme.primaryText};
16+
}
17+
18+
[class$="rect-fg"] {
19+
fill: ${({ theme }) => theme.whiteBackground};
20+
stroke: ${({ theme }) => theme.stroke};
21+
}
22+
23+
[class$="rect-accent"] {
24+
fill: ${({ theme }) => theme.primaryBlue};
25+
}
26+
27+
[class$="path-4"] {
28+
fill: ${({ theme }) => theme.whiteBackground};
29+
}
30+
31+
[class$="path-5"] {
32+
fill: ${({ theme }) => theme.secondaryText};
33+
}
34+
`;
35+
36+
const CrowdfundAppeal: React.FC = () => <StyledImage as={StyledCrowdfundAppealSvg} />;
37+
38+
export default CrowdfundAppeal;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
import PayoffSimulatorSvg from "tsx:assets/svgs/mini-guides/appeal/payoff-simulator.svg";
4+
import { StyledImage } from "../PageContentsTemplate";
5+
6+
const StyledPayoffSimulatorSvg = styled(PayoffSimulatorSvg)`
7+
[class$="circle-1"] {
8+
fill: ${({ theme }) => theme.successLight};
9+
}
10+
11+
[class$="rect-2"] {
12+
fill: ${({ theme }) => theme.mediumBlue};
13+
}
14+
15+
[class$="circle-2"] {
16+
fill: ${({ theme }) => theme.mediumPurple};
17+
}
18+
19+
[class$="rect-1"],
20+
[class$="rect-5"] {
21+
fill: ${({ theme }) => theme.whiteBackground};
22+
stroke: ${({ theme }) => theme.stroke};
23+
}
24+
25+
[class$="rect-6"],
26+
[class$="rect-7"],
27+
[class$="rect-8"] {
28+
fill: ${({ theme }) => theme.white};
29+
}
30+
31+
[class$="path-2"] {
32+
fill: ${({ theme }) => theme.success};
33+
}
34+
35+
[class$="path-3"],
36+
[class$="path-16"] {
37+
fill: ${({ theme }) => theme.secondaryPurple};
38+
}
39+
40+
[class$="path-11"],
41+
[class$="path-13"] {
42+
fill: ${({ theme }) => theme.whiteBackground};
43+
}
44+
45+
[class$="path-4"],
46+
[class$="path-5"],
47+
[class$="path-6"],
48+
[class$="path-7"],
49+
[class$="path-8"],
50+
[class$="path-9"],
51+
[class$="path-10"],
52+
[class$="path-12"],
53+
[class$="path-14"],
54+
[class$="path-15"],
55+
[class$="path-17"] {
56+
fill: ${({ theme }) => theme.primaryText};
57+
}
58+
59+
[class$="rect-3"],
60+
[class$="rect-4"] {
61+
fill: ${({ theme }) => theme.primaryBlue};
62+
}
63+
64+
[class$="line-1"],
65+
[class$="line-2"],
66+
[class$="path-1"] {
67+
stroke: ${({ theme }) => theme.mediumBlue};
68+
}
69+
70+
[class$="path-1"] {
71+
fill: ${({ theme }) => theme.lightBlue};
72+
}
73+
`;
74+
75+
const PayoffSimulator: React.FC = () => <StyledImage as={StyledPayoffSimulatorSvg} />;
76+
77+
export default PayoffSimulator;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
import StageOneSvg from "tsx:assets/svgs/mini-guides/appeal/stage-one.svg";
4+
import { StyledImage } from "../PageContentsTemplate";
5+
6+
const StyledStageOneSvg = styled(StageOneSvg)`
7+
[class$="rect-1"],
8+
[class$="rect-2"],
9+
[class$="rect-6"],
10+
[class$="circle-1"],
11+
[class$="circle-2"] {
12+
fill: ${({ theme }) => theme.whiteBackground};
13+
}
14+
15+
[class$="rect-4"],
16+
[class$="rect-8"] {
17+
fill: ${({ theme }) => theme.stroke};
18+
}
19+
20+
[class$="rect-5"],
21+
[class$="path-9"],
22+
[class$="path-10"] {
23+
fill: ${({ theme }) => theme.secondaryPurple};
24+
}
25+
26+
[class$="rect-9"],
27+
[class$="circle-3"] {
28+
fill: ${({ theme }) => theme.primaryBlue};
29+
}
30+
31+
[class$="rect-10"] {
32+
fill: ${({ theme }) => theme.lightBlue};
33+
stroke: ${({ theme }) => theme.mediumBlue};
34+
}
35+
36+
[class$="rect-11"],
37+
[class$="rect-12"] {
38+
fill: ${({ theme }) => theme.white};
39+
}
40+
41+
[class$="path-2"],
42+
[class$="path-6"] {
43+
fill: ${({ theme }) => theme.primaryText};
44+
}
45+
46+
[class$="path-1"],
47+
[class$="path-5"] {
48+
fill: ${({ theme }) => theme.secondaryText};
49+
}
50+
51+
[class$="path-3"],
52+
[class$="path-4"] {
53+
fill: ${({ theme }) => theme.success};
54+
}
55+
56+
[class$="path-7"],
57+
[class$="path-8"] {
58+
fill: ${({ theme }) => theme.warning};
59+
}
60+
61+
[class$="rect-3"],
62+
[class$="rect-7"],
63+
[class$="circle-1"] {
64+
stroke: ${({ theme }) => theme.stroke};
65+
}
66+
67+
[class$="circle-2"] {
68+
stroke: ${({ theme }) => theme.primaryBlue};
69+
}
70+
`;
71+
72+
const StageOne: React.FC = () => <StyledImage as={StyledStageOneSvg} />;
73+
74+
export default StageOne;

0 commit comments

Comments
 (0)