Skip to content

Commit 4bb9c1d

Browse files
authored
Merge pull request #1801 from kleros/dev
Release v2-testnet-4.0.2
2 parents 158122b + 20ac82c commit 4bb9c1d

Some content is hidden

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

47 files changed

+350
-134
lines changed

web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"@kleros/kleros-app": "^2.0.1",
8282
"@kleros/kleros-sdk": "workspace:^",
8383
"@kleros/kleros-v2-contracts": "workspace:^",
84-
"@kleros/ui-components-library": "^2.16.0",
84+
"@kleros/ui-components-library": "^2.18.0",
8585
"@lifi/wallet-management": "^3.4.6",
8686
"@lifi/widget": "^3.12.3",
8787
"@sentry/react": "^7.120.0",

web/src/assets/svgs/icons/star.svg

+1
Loading

web/src/components/CaseStarButton.tsx

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import React, { useMemo } from "react";
2+
import styled, { css } from "styled-components";
3+
4+
import { Button, Tooltip } from "@kleros/ui-components-library";
5+
6+
import Star from "svgs/icons/star.svg";
7+
8+
import useIsDesktop from "hooks/useIsDesktop";
9+
import useStarredCases from "hooks/useStarredCases";
10+
11+
const StyledButton = styled(Button)<{ starred: boolean }>`
12+
background: none;
13+
padding: 0 0 2px 0;
14+
15+
.button-svg {
16+
width: 24px;
17+
height: 24px;
18+
margin: 0;
19+
fill: none;
20+
21+
path {
22+
stroke: ${({ theme }) => theme.secondaryPurple};
23+
}
24+
${({ starred }) =>
25+
starred &&
26+
css`
27+
fill: ${({ theme }) => theme.secondaryPurple};
28+
`};
29+
}
30+
31+
:hover {
32+
background: none;
33+
}
34+
`;
35+
36+
const CaseStarButton: React.FC<{ id: string }> = ({ id }) => {
37+
const { starredCases, starCase } = useStarredCases();
38+
const isDesktop = useIsDesktop();
39+
const starred = useMemo(() => Boolean(starredCases.has(id)), [id, starredCases]);
40+
const text = starred ? "Remove from favorite" : "Add to favorite";
41+
return (
42+
<Tooltip {...{ text }} place={isDesktop ? "right" : "bottom"}>
43+
<StyledButton
44+
Icon={Star}
45+
text=""
46+
starred={starred}
47+
aria-label={text}
48+
aria-checked={starred}
49+
onClick={(e) => {
50+
e.stopPropagation();
51+
starCase(id);
52+
}}
53+
/>
54+
</Tooltip>
55+
);
56+
};
57+
58+
export default CaseStarButton;

web/src/components/CasesDisplay/Filters.tsx

+17-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from "react";
2-
import styled, { useTheme } from "styled-components";
2+
import styled, { css, useTheme } from "styled-components";
3+
4+
import { hoverShortTransitionTiming } from "styles/commonStyles";
35

46
import { useNavigate, useParams } from "react-router-dom";
57

@@ -19,29 +21,32 @@ const Container = styled.div`
1921
width: fit-content;
2022
`;
2123

22-
const StyledGridIcon = styled(GridIcon)`
23-
cursor: pointer;
24-
transition: filter 0.2s ease;
25-
fill: ${({ theme }) => theme.primaryBlue};
26-
width: 16px;
27-
height: 16px;
28-
overflow: hidden;
29-
`;
30-
3124
const IconsContainer = styled.div`
3225
display: flex;
3326
justify-content: center;
3427
align-items: center;
3528
gap: 4px;
3629
`;
3730

38-
const StyledListIcon = styled(ListIcon)`
31+
const BaseIconStyles = css`
32+
${hoverShortTransitionTiming}
3933
cursor: pointer;
40-
transition: filter 0.2s ease;
4134
fill: ${({ theme }) => theme.primaryBlue};
4235
width: 16px;
4336
height: 16px;
4437
overflow: hidden;
38+
39+
:hover {
40+
fill: ${({ theme }) => theme.secondaryBlue};
41+
}
42+
`;
43+
44+
const StyledGridIcon = styled(GridIcon)`
45+
${BaseIconStyles}
46+
`;
47+
48+
const StyledListIcon = styled(ListIcon)`
49+
${BaseIconStyles}
4550
`;
4651

4752
const Filters: React.FC = () => {

web/src/components/CasesDisplay/Search.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ import { responsiveSize } from "styles/responsiveSize";
1818
const Container = styled.div`
1919
display: flex;
2020
flex-direction: column;
21-
gap: 4px;
21+
gap: ${responsiveSize(8, 16)};
2222
2323
${landscapeStyle(
24-
() =>
25-
css`
26-
flex-direction: row;
27-
gap: ${responsiveSize(4, 22)};
28-
`
24+
() => css`
25+
flex-direction: row;
26+
`
2927
)}
3028
`;
3129

web/src/components/CasesDisplay/StatsAndFilters.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import React from "react";
22
import styled from "styled-components";
33

4+
import { responsiveSize } from "styles/responsiveSize";
5+
46
import Filters from "./Filters";
57
import Stats, { IStats } from "./Stats";
68

79
const Container = styled.div`
810
display: flex;
911
flex-wrap: wrap;
1012
gap: 8px;
11-
margin-top: 11px;
12-
margin-bottom: 48px;
13+
margin-top: ${responsiveSize(4, 8)};
14+
margin-bottom: ${responsiveSize(16, 32)};
1315
justify-content: space-between;
1416
`;
1517

web/src/components/CasesDisplay/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const TitleContainer = styled.div`
1717
justify-content: space-between;
1818
align-items: center;
1919
flex-wrap: wrap;
20-
margin-bottom: ${responsiveSize(32, 48)};
20+
margin-bottom: ${responsiveSize(12, 24)};
2121
`;
2222

2323
const StyledTitle = styled.h1`

web/src/components/DisputePreview/Policies.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { getIpfsUrl } from "utils/getIpfsUrl";
88
import { isUndefined } from "utils/index";
99

1010
import { responsiveSize } from "styles/responsiveSize";
11+
import { hoverShortTransitionTiming } from "styles/commonStyles";
1112

1213
import { InternalLink } from "components/InternalLink";
1314

@@ -38,12 +39,12 @@ const StyledPaperclipIcon = styled(PaperclipIcon)`
3839
`;
3940

4041
const StyledInternalLink = styled(InternalLink)`
42+
${hoverShortTransitionTiming}
4143
display: flex;
4244
gap: 4px;
4345
4446
&:hover {
4547
svg {
46-
transition: fill 0.1s;
4748
fill: ${({ theme }) => theme.secondaryBlue};
4849
}
4950
}

web/src/components/DisputeView/DisputeCardView.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ import { Card } from "@kleros/ui-components-library";
88
import { Periods } from "consts/periods";
99

1010
import { responsiveSize } from "styles/responsiveSize";
11+
import { hoverShortTransitionTiming } from "styles/commonStyles";
1112

1213
import { StyledSkeleton } from "components/StyledSkeleton";
1314

1415
import DisputeInfo from "./DisputeInfo";
1516
import PeriodBanner from "./PeriodBanner";
1617

1718
const StyledCard = styled(Card)`
19+
${hoverShortTransitionTiming}
1820
width: 100%;
1921
height: 100%;
2022
max-height: 335px;
2123
min-height: 290px;
22-
transition: background-color 0.1s;
23-
24-
&:hover {
25-
background-color: ${({ theme }) => theme.lightGrey}BB;
26-
}
2724
`;
2825

2926
const CardContainer = styled.div`
@@ -61,7 +58,7 @@ interface IDisputeCardView {
6158
const DisputeCardView: React.FC<IDisputeCardView> = ({ isLoading, ...props }) => {
6259
return (
6360
<Link to={`/cases/${props?.disputeID?.toString()}`}>
64-
<StyledCard>
61+
<StyledCard hover>
6562
<PeriodBanner id={parseInt(props?.disputeID)} period={props?.period} />
6663
<CardContainer>
6764
{isLoading ? <StyledCaseCardTitleSkeleton /> : <TruncatedTitle text={props?.title} maxLength={100} />}

web/src/components/DisputeView/DisputeListView.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@ import { Card } from "@kleros/ui-components-library";
99
import { Periods } from "consts/periods";
1010

1111
import { responsiveSize } from "styles/responsiveSize";
12+
import { hoverShortTransitionTiming } from "styles/commonStyles";
1213

1314
import DisputeInfo from "./DisputeInfo";
1415
import PeriodBanner from "./PeriodBanner";
1516

1617
const StyledListItem = styled(Card)`
18+
${hoverShortTransitionTiming}
1719
display: flex;
1820
flex-grow: 1;
1921
width: 100%;
2022
height: 82px;
21-
transition: background-color 0.1s;
22-
23-
&:hover {
24-
background-color: ${({ theme }) => theme.lightGrey}BB;
25-
}
2623
`;
2724

2825
const ListContainer = styled.div`
@@ -64,7 +61,7 @@ const DisputeListView: React.FC<IDisputeListView> = (props) => {
6461
const { isDisconnected } = useAccount();
6562
return (
6663
<Link to={`/cases/${props?.disputeID?.toString()}`}>
67-
<StyledListItem>
64+
<StyledListItem hover>
6865
<PeriodBanner isCard={false} id={parseInt(props?.disputeID ?? "0")} period={props.period} />
6966
<ListContainer>
7067
<TitleContainer isLabel={!isDisconnected}>

web/src/components/DottedMenuButton.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from "react";
22
import styled, { css, keyframes } from "styled-components";
33

4+
import { hoverShortTransitionTiming } from "styles/commonStyles";
5+
46
import DottedMenu from "svgs/icons/dotted-menu.svg";
57

68
const ripple = keyframes`
@@ -57,13 +59,16 @@ const Container = styled.div<{ displayRipple: boolean }>`
5759
`;
5860

5961
const ButtonContainer = styled.div`
62+
${hoverShortTransitionTiming}
6063
border-radius: 50%;
6164
z-index: 1;
6265
background-color: ${({ theme }) => theme.lightBackground};
6366
64-
transition: background-color 0.1s;
6567
:hover {
6668
background-color: ${({ theme }) => theme.lightGrey};
69+
svg {
70+
fill: ${({ theme }) => theme.secondaryBlue};
71+
}
6772
}
6873
`;
6974

web/src/components/EvidenceCard.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled, { css } from "styled-components";
33

44
import { landscapeStyle } from "styles/landscapeStyle";
55
import { responsiveSize } from "styles/responsiveSize";
6+
import { hoverShortTransitionTiming } from "styles/commonStyles";
67

78
import Identicon from "react-identicons";
89
import ReactMarkdown from "react-markdown";
@@ -165,6 +166,7 @@ const MobileText = styled.span`
165166
`;
166167

167168
const StyledInternalLink = styled(InternalLink)`
169+
${hoverShortTransitionTiming}
168170
display: flex;
169171
gap: ${responsiveSize(5, 6)};
170172
> svg {
@@ -173,7 +175,6 @@ const StyledInternalLink = styled(InternalLink)`
173175
}
174176
175177
:hover svg {
176-
transition: fill 0.1s;
177178
fill: ${({ theme }) => theme.secondaryBlue};
178179
}
179180
`;

web/src/components/ExtraStatsDisplay.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const Container = styled.div`
99
display: flex;
1010
gap: 8px;
1111
align-items: center;
12-
margin-top: 24px;
1312
`;
1413

1514
const SVGContainer = styled.div`

0 commit comments

Comments
 (0)