Skip to content

Commit 3e2bc96

Browse files
authored
Merge pull request #1986 from kleros/feat/add-pages-redirection-in-homepage
feat: all cases button, few style impros
2 parents c055621 + 38a87dc commit 3e2bc96

File tree

7 files changed

+67
-17
lines changed

7 files changed

+67
-17
lines changed

web/src/components/AllCasesButton.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from "react";
2+
3+
import styled from "styled-components";
4+
5+
import DocIcon from "svgs/icons/doc.svg";
6+
7+
import { BlueIconTextButtonContainer } from "./BlueIconTextButtonContainer";
8+
import { InternalLink } from "./InternalLink";
9+
10+
const StyledDocIcon = styled(DocIcon)`
11+
width: 16px;
12+
height: 16px;
13+
`;
14+
15+
const AllCasesButton: React.FC = () => {
16+
return (
17+
<InternalLink to={"/cases/display/1/desc/all"}>
18+
<BlueIconTextButtonContainer>
19+
<StyledDocIcon />
20+
<label>All Cases</label>
21+
</BlueIconTextButtonContainer>
22+
</InternalLink>
23+
);
24+
};
25+
26+
export default AllCasesButton;

web/src/components/BlueIconTextButtonContainer.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ export const BlueIconTextButtonContainer = styled.div`
99
font-weight: 400;
1010
gap: 8px;
1111
cursor: pointer;
12-
color: ${({ theme }) => theme.primaryBlue};
1312
1413
svg path {
1514
fill: ${({ theme }) => theme.primaryBlue};
1615
}
1716
17+
label {
18+
margin-top: 1px;
19+
color: ${({ theme }) => theme.primaryBlue};
20+
}
21+
1822
&:hover {
19-
color: ${({ theme }) => theme.secondaryBlue};
2023
svg path {
2124
fill: ${({ theme }) => theme.secondaryBlue};
2225
}
26+
label {
27+
cursor: pointer;
28+
color: ${({ theme }) => theme.secondaryBlue};
29+
}
2330
}
2431
`;

web/src/components/CasesDisplay/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const CasesDisplay: React.FC<ICasesDisplay> = ({
5555
totalPages,
5656
}) => {
5757
const location = useLocation();
58-
const { isConnected, address } = useAccount();
59-
const profileLink = isConnected && address ? `/profile/1/desc/all?address=${address}` : null;
58+
const { isConnected } = useAccount();
59+
const profileLink = isConnected ? `/profile/1/desc/all` : null;
6060

6161
return (
6262
<div {...{ className }}>

web/src/components/HowItWorks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const HowItWorks: React.FC<IHowItWorks> = ({ isMiniGuideOpen, toggleMiniGuide, M
1515
<>
1616
<BlueIconTextButtonContainer onClick={toggleMiniGuide}>
1717
<BookOpenIcon />
18-
How it works
18+
<label>How it works</label>
1919
</BlueIconTextButtonContainer>
2020
{isMiniGuideOpen && <MiniGuideComponent toggleMiniGuide={toggleMiniGuide} />}
2121
</>

web/src/components/JurorsLeaderboardButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const JurorsLeaderboardButton: React.FC = () => {
1010
<InternalLink to={"/jurors/1/desc/all"}>
1111
<BlueIconTextButtonContainer>
1212
<RankingIcon />
13-
Jurors Leaderboard
13+
<label>Jurors Leaderboard</label>
1414
</BlueIconTextButtonContainer>
1515
</InternalLink>
1616
);

web/src/components/LatestCases.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import DisputeView from "components/DisputeView";
1111
import { SkeletonDisputeCard } from "components/StyledSkeleton";
1212

1313
import { Dispute_Filter } from "../graphql/graphql";
14+
import AllCasesButton from "./AllCasesButton";
1415

1516
const Container = styled.div`
1617
margin-top: ${responsiveSize(28, 48)};
@@ -29,6 +30,12 @@ const DisputeContainer = styled.div`
2930
gap: var(--gap);
3031
`;
3132

33+
const ButtonContainer = styled.div`
34+
display: flex;
35+
margin-top: 16px;
36+
justify-content: center;
37+
`;
38+
3239
const LatestCases: React.FC<{ filters?: Dispute_Filter }> = ({ filters }) => {
3340
const { data } = useCasesQuery(0, 3, filters);
3441
const disputes: DisputeDetailsFragment[] = useMemo(() => data?.disputes as DisputeDetailsFragment[], [data]);
@@ -41,6 +48,9 @@ const LatestCases: React.FC<{ filters?: Dispute_Filter }> = ({ filters }) => {
4148
? Array.from({ length: 3 }).map((_, index) => <SkeletonDisputeCard key={index} />)
4249
: disputes.map((dispute) => <DisputeView key={dispute.id} {...dispute} overrideIsList />)}
4350
</DisputeContainer>
51+
<ButtonContainer>
52+
<AllCasesButton />
53+
</ButtonContainer>
4454
</Container>
4555
) : null;
4656
};

web/src/pages/Profile/JurorInfo/Header.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,23 @@ const StyledXIcon = styled(XIcon)`
4646
fill: ${({ theme }) => theme.primaryBlue};
4747
`;
4848

49-
const StyledLink = styled(ExternalLink)`
50-
display: flex;
51-
gap: 8px;
52-
`;
53-
54-
const StyledExternalLink = styled(ExternalLink)`
49+
const StyledJurorExternalLink = styled(ExternalLink)`
5550
font-size: ${responsiveSize(18, 22)};
5651
margin-left: ${responsiveSize(4, 8)};
5752
font-weight: 600;
5853
`;
5954

55+
const StyledShareExternalLink = styled(ExternalLink)`
56+
display: flex;
57+
gap: 6px;
58+
`;
59+
60+
const StyledShareLabel = styled.label`
61+
margin-top: 1px;
62+
color: ${({ theme }) => theme.primaryBlue};
63+
cursor: pointer;
64+
`;
65+
6066
interface IHeader {
6167
levelTitle: string;
6268
levelNumber: number;
@@ -90,9 +96,9 @@ const Header: React.FC<IHeader> = ({
9096
<StyledTitle>
9197
Juror Profile -
9298
<Copiable copiableContent={addressToQuery} info="Copy Address">
93-
<StyledExternalLink to={addressExplorerLink} target="_blank" rel="noopener noreferrer">
99+
<StyledJurorExternalLink to={addressExplorerLink} target="_blank" rel="noopener noreferrer">
94100
{shortenAddress(addressToQuery)}
95-
</StyledExternalLink>
101+
</StyledJurorExternalLink>
96102
</Copiable>
97103
</StyledTitle>
98104
<LinksContainer>
@@ -103,9 +109,10 @@ const Header: React.FC<IHeader> = ({
103109
MiniGuideComponent={JurorLevels}
104110
/>
105111
{totalResolvedVotes > 0 && !searchParamAddress ? (
106-
<StyledLink to={xShareUrl} target="_blank" rel="noreferrer">
107-
<StyledXIcon /> <span>Share your juror score</span>
108-
</StyledLink>
112+
<StyledShareExternalLink to={xShareUrl} target="_blank" rel="noreferrer">
113+
<StyledXIcon />
114+
<StyledShareLabel>Share your juror score</StyledShareLabel>
115+
</StyledShareExternalLink>
109116
) : null}
110117
</LinksContainer>
111118
</Container>

0 commit comments

Comments
 (0)