Skip to content

Commit 53e4bc4

Browse files
committed
feat: hover effects in case cards, anchors, bug fix in court page
1 parent 49932e2 commit 53e4bc4

File tree

10 files changed

+68
-55
lines changed

10 files changed

+68
-55
lines changed

web/src/components/CasesDisplay/index.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import ArrowIcon from "svgs/icons/arrow.svg";
77

88
import { responsiveSize } from "styles/responsiveSize";
99

10-
import LightButton from "../LightButton";
11-
1210
import CasesGrid, { ICasesGrid } from "./CasesGrid";
1311
import Search from "./Search";
1412
import StatsAndFilters from "./StatsAndFilters";
13+
import { StyledArrowLink } from "../StyledArrowLink";
1514

1615
const TitleContainer = styled.div`
1716
display: flex;
@@ -25,16 +24,6 @@ const StyledTitle = styled.h1`
2524
margin: 0px;
2625
`;
2726

28-
const StyledButton = styled(LightButton)`
29-
display: flex;
30-
flex-direction: row-reverse;
31-
gap: 8px;
32-
> .button-text {
33-
color: ${({ theme }) => theme.primaryBlue};
34-
}
35-
padding: 0px;
36-
`;
37-
3827
interface ICasesDisplay extends ICasesGrid {
3928
numberDisputes?: number;
4029
numberClosedDisputes?: number;
@@ -59,9 +48,9 @@ const CasesDisplay: React.FC<ICasesDisplay> = ({
5948
<TitleContainer className="title">
6049
<StyledTitle>{title}</StyledTitle>
6150
{location.pathname.startsWith("/cases/display/1/desc/all") ? (
62-
<Link to={"/resolver"}>
63-
<StyledButton text="Create a case" Icon={ArrowIcon} />
64-
</Link>
51+
<StyledArrowLink to={"/resolver"}>
52+
Create a case <ArrowIcon />
53+
</StyledArrowLink>
6554
) : null}
6655
</TitleContainer>
6756
<Search />

web/src/components/DisputeView/DisputeCardView.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ const StyledCard = styled(Card)`
1919
height: 100%;
2020
max-height: 335px;
2121
min-height: 290px;
22+
transition: background-color 0.1s;
23+
24+
&:hover {
25+
background-color: ${({ theme }) => theme.lightGrey};
26+
}
2227
`;
2328

2429
const CardContainer = styled.div`
@@ -56,7 +61,7 @@ interface IDisputeCardView {
5661
const DisputeCardView: React.FC<IDisputeCardView> = ({ isLoading, ...props }) => {
5762
return (
5863
<Link to={`/cases/${props?.disputeID?.toString()}`}>
59-
<StyledCard hover>
64+
<StyledCard>
6065
<PeriodBanner id={parseInt(props?.disputeID)} period={props?.period} />
6166
<CardContainer>
6267
{isLoading ? <StyledCaseCardTitleSkeleton /> : <TruncatedTitle text={props?.title} maxLength={100} />}

web/src/components/DisputeView/DisputeListView.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ const StyledListItem = styled(Card)`
1818
flex-grow: 1;
1919
width: 100%;
2020
height: 82px;
21+
transition: background-color 0.1s;
22+
23+
&:hover {
24+
background-color: ${({ theme }) => theme.lightGrey};
25+
}
2126
`;
27+
2228
const ListContainer = styled.div`
2329
display: flex;
2430
justify-content: space-between;
@@ -58,7 +64,7 @@ const DisputeListView: React.FC<IDisputeListView> = (props) => {
5864
const { isDisconnected } = useAccount();
5965
return (
6066
<Link to={`/cases/${props?.disputeID?.toString()}`}>
61-
<StyledListItem hover>
67+
<StyledListItem>
6268
<PeriodBanner isCard={false} id={parseInt(props?.disputeID ?? "0")} period={props.period} />
6369
<ListContainer>
6470
<TitleContainer isLabel={!isDisconnected}>

web/src/components/Field.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ const StyledLink = styled(Link)`
6262
color: ${({ theme }) => theme.primaryBlue};
6363
text-wrap: auto;
6464
justify-content: end;
65+
66+
&:hover {
67+
text-decoration: underline ${({ theme }) => theme.secondaryBlue};
68+
}
6569
`;
6670

6771
type FieldContainerProps = {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import styled from "styled-components";
2+
3+
import { Link } from "react-router-dom";
4+
5+
export const StyledArrowLink = styled(Link)`
6+
display: flex;
7+
gap: 8px;
8+
align-items: center;
9+
font-size: 16px;
10+
11+
> svg {
12+
height: 16px;
13+
width: 16px;
14+
15+
path {
16+
fill: ${({ theme }) => theme.primaryBlue};
17+
}
18+
}
19+
20+
&:hover svg path {
21+
fill: ${({ theme }) => theme.secondaryBlue};
22+
}
23+
`;

web/src/components/Verdict/FinalDecision.tsx

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useMemo } from "react";
22
import styled from "styled-components";
33

44
import Skeleton from "react-loading-skeleton";
5-
import { useNavigate, useParams } from "react-router-dom";
5+
import { useParams } from "react-router-dom";
66
import { useAccount } from "wagmi";
77

88
import ArrowIcon from "svgs/icons/arrow.svg";
@@ -19,11 +19,10 @@ import { useDisputeDetailsQuery } from "queries/useDisputeDetailsQuery";
1919

2020
import { responsiveSize } from "styles/responsiveSize";
2121

22-
import LightButton from "../LightButton";
23-
2422
import AnswerDisplay from "./Answer";
2523
import VerdictBanner from "./VerdictBanner";
2624
import { Divider } from "../Divider";
25+
import { StyledArrowLink } from "../StyledArrowLink";
2726

2827
const Container = styled.div`
2928
width: 100%;
@@ -45,16 +44,6 @@ const JuryDecisionTag = styled.small`
4544
color: ${({ theme }) => theme.secondaryText};
4645
`;
4746

48-
const StyledButton = styled(LightButton)`
49-
display: flex;
50-
flex-direction: row-reverse;
51-
gap: 8px;
52-
> .button-text {
53-
color: ${({ theme }) => theme.primaryBlue};
54-
}
55-
padding-top: 0px;
56-
`;
57-
5847
const StyledDivider = styled(Divider)`
5948
margin: ${responsiveSize(16, 32)} 0px;
6049
`;
@@ -73,7 +62,6 @@ const FinalDecision: React.FC<IFinalDecision> = ({ arbitrable }) => {
7362
const localRounds = getLocalRounds(votingHistory?.dispute?.disputeKitDispute);
7463
const ruled = disputeDetails?.dispute?.ruled ?? false;
7564
const periodIndex = Periods[disputeDetails?.dispute?.period ?? "evidence"];
76-
const navigate = useNavigate();
7765
const { data: currentRulingArray } = useReadKlerosCoreCurrentRuling({
7866
query: { refetchInterval: REFETCH_INTERVAL },
7967
args: [BigInt(id ?? 0)],
@@ -108,12 +96,9 @@ const FinalDecision: React.FC<IFinalDecision> = ({ arbitrable }) => {
10896
{isLoading && !isDisconnected ? (
10997
<Skeleton width={250} height={20} />
11098
) : (
111-
<StyledButton
112-
onClick={() => navigate(`/cases/${id?.toString()}/voting`)}
113-
text={buttonText}
114-
Icon={ArrowIcon}
115-
className="reverse-button"
116-
/>
99+
<StyledArrowLink to={`/cases/${id?.toString()}/voting`}>
100+
{buttonText} <ArrowIcon />
101+
</StyledArrowLink>
117102
)}
118103
</Container>
119104
);

web/src/pages/Courts/CourtDetails/Description.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const Description: React.FC = () => {
9595
<Route path="purpose" element={formatMarkdown(policy?.description)} />
9696
<Route path="skills" element={<p>{policy?.requiredSkills}</p>} />
9797
<Route path="policy" element={formatMarkdown(policy?.summary)} />
98-
<Route path="*" element={<Navigate to="purpose" replace />} />
98+
<Route path="*" element={<Navigate to={filteredTabs.length > 0 ? filteredTabs[0].path : ""} replace />} />
9999
</Routes>
100100
</TextContainer>
101101
</Container>

web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import styled, { css } from "styled-components";
44
import { landscapeStyle } from "styles/landscapeStyle";
55

66
import ArrowIcon from "svgs/icons/arrow.svg";
7-
import { Link } from "react-router-dom";
7+
8+
import { StyledArrowLink } from "components/StyledArrowLink";
89

910
const Container = styled.div`
1011
display: flex;
@@ -20,24 +21,19 @@ const Container = styled.div`
2021
}
2122
2223
${landscapeStyle(
23-
() =>
24-
css`
25-
justify-content: flex-start;
26-
width: auto;
27-
`
24+
() => css`
25+
justify-content: flex-start;
26+
width: auto;
27+
`
2828
)}
2929
`;
3030

31-
const StyledLink = styled(Link)`
32-
display: flex;
33-
gap: 8px;
34-
align-items: center;
31+
const ReStyledArrowLink = styled(StyledArrowLink)`
32+
font-size: 14px;
33+
3534
> svg {
3635
height: 15px;
3736
width: 15px;
38-
path {
39-
fill: ${({ theme }) => theme.primaryBlue};
40-
}
4137
}
4238
`;
4339

@@ -50,9 +46,9 @@ const CourtName: React.FC<ICourtName> = ({ name, id }) => {
5046
return (
5147
<Container>
5248
<small>{name}</small>
53-
<StyledLink to={`/courts/${id?.toString()}`}>
49+
<ReStyledArrowLink to={`/courts/${id?.toString()}`}>
5450
Open Court <ArrowIcon />
55-
</StyledLink>
51+
</ReStyledArrowLink>
5652
</Container>
5753
);
5854
};

web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const StyledA = styled.a`
2525
text-decoration: underline;
2626
label {
2727
cursor: pointer;
28-
color: ${({ theme }) => theme.primaryBlue};
28+
color: ${({ theme }) => theme.secondaryBlue};
2929
}
3030
}
3131
`;

web/src/styles/global-style.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ export const GlobalStyle = createGlobalStyle`
9090
font-size: 14px;
9191
text-decoration: none;
9292
color: ${({ theme }) => theme.primaryBlue};
93+
transition: color 0.1s;
9394
}
94-
95+
96+
a:hover {
97+
color: ${({ theme }) => theme.secondaryBlue} !important;
98+
}
99+
95100
hr {
96101
opacity: 1;
97102
border: 1px solid ${({ theme }) => theme.stroke};

0 commit comments

Comments
 (0)