From 53e4bc4948a0e9c2277b3de414338479b38c18da Mon Sep 17 00:00:00 2001
From: kemuru <102478601+kemuru@users.noreply.github.com>
Date: Sun, 1 Dec 2024 16:56:19 +0100
Subject: [PATCH 01/11] feat: hover effects in case cards, anchors, bug fix in
court page
---
web/src/components/CasesDisplay/index.tsx | 19 +++-----------
.../DisputeView/DisputeCardView.tsx | 7 ++++-
.../DisputeView/DisputeListView.tsx | 8 +++++-
web/src/components/Field.tsx | 4 +++
web/src/components/StyledArrowLink.tsx | 23 ++++++++++++++++
web/src/components/Verdict/FinalDecision.tsx | 25 ++++--------------
.../pages/Courts/CourtDetails/Description.tsx | 2 +-
.../Dashboard/Courts/CourtCard/CourtName.tsx | 26 ++++++++-----------
.../Home/TopJurors/JurorCard/JurorTitle.tsx | 2 +-
web/src/styles/global-style.ts | 7 ++++-
10 files changed, 68 insertions(+), 55 deletions(-)
create mode 100644 web/src/components/StyledArrowLink.tsx
diff --git a/web/src/components/CasesDisplay/index.tsx b/web/src/components/CasesDisplay/index.tsx
index 5fdf19a3b..5f0d052b3 100644
--- a/web/src/components/CasesDisplay/index.tsx
+++ b/web/src/components/CasesDisplay/index.tsx
@@ -7,11 +7,10 @@ import ArrowIcon from "svgs/icons/arrow.svg";
import { responsiveSize } from "styles/responsiveSize";
-import LightButton from "../LightButton";
-
import CasesGrid, { ICasesGrid } from "./CasesGrid";
import Search from "./Search";
import StatsAndFilters from "./StatsAndFilters";
+import { StyledArrowLink } from "../StyledArrowLink";
const TitleContainer = styled.div`
display: flex;
@@ -25,16 +24,6 @@ const StyledTitle = styled.h1`
margin: 0px;
`;
-const StyledButton = styled(LightButton)`
- display: flex;
- flex-direction: row-reverse;
- gap: 8px;
- > .button-text {
- color: ${({ theme }) => theme.primaryBlue};
- }
- padding: 0px;
-`;
-
interface ICasesDisplay extends ICasesGrid {
numberDisputes?: number;
numberClosedDisputes?: number;
@@ -59,9 +48,9 @@ const CasesDisplay: React.FC = ({
{title}
{location.pathname.startsWith("/cases/display/1/desc/all") ? (
-
-
-
+
+ Create a case
+
) : null}
diff --git a/web/src/components/DisputeView/DisputeCardView.tsx b/web/src/components/DisputeView/DisputeCardView.tsx
index 1027b0436..fbc489e6d 100644
--- a/web/src/components/DisputeView/DisputeCardView.tsx
+++ b/web/src/components/DisputeView/DisputeCardView.tsx
@@ -19,6 +19,11 @@ const StyledCard = styled(Card)`
height: 100%;
max-height: 335px;
min-height: 290px;
+ transition: background-color 0.1s;
+
+ &:hover {
+ background-color: ${({ theme }) => theme.lightGrey};
+ }
`;
const CardContainer = styled.div`
@@ -56,7 +61,7 @@ interface IDisputeCardView {
const DisputeCardView: React.FC = ({ isLoading, ...props }) => {
return (
-
+
{isLoading ? : }
diff --git a/web/src/components/DisputeView/DisputeListView.tsx b/web/src/components/DisputeView/DisputeListView.tsx
index cbecdeedb..9504a5e15 100644
--- a/web/src/components/DisputeView/DisputeListView.tsx
+++ b/web/src/components/DisputeView/DisputeListView.tsx
@@ -18,7 +18,13 @@ const StyledListItem = styled(Card)`
flex-grow: 1;
width: 100%;
height: 82px;
+ transition: background-color 0.1s;
+
+ &:hover {
+ background-color: ${({ theme }) => theme.lightGrey};
+ }
`;
+
const ListContainer = styled.div`
display: flex;
justify-content: space-between;
@@ -58,7 +64,7 @@ const DisputeListView: React.FC = (props) => {
const { isDisconnected } = useAccount();
return (
-
+
diff --git a/web/src/components/Field.tsx b/web/src/components/Field.tsx
index 94cc74f9e..d407d82c3 100644
--- a/web/src/components/Field.tsx
+++ b/web/src/components/Field.tsx
@@ -62,6 +62,10 @@ const StyledLink = styled(Link)`
color: ${({ theme }) => theme.primaryBlue};
text-wrap: auto;
justify-content: end;
+
+ &:hover {
+ text-decoration: underline ${({ theme }) => theme.secondaryBlue};
+ }
`;
type FieldContainerProps = {
diff --git a/web/src/components/StyledArrowLink.tsx b/web/src/components/StyledArrowLink.tsx
new file mode 100644
index 000000000..3d7a7abf2
--- /dev/null
+++ b/web/src/components/StyledArrowLink.tsx
@@ -0,0 +1,23 @@
+import styled from "styled-components";
+
+import { Link } from "react-router-dom";
+
+export const StyledArrowLink = styled(Link)`
+ display: flex;
+ gap: 8px;
+ align-items: center;
+ font-size: 16px;
+
+ > svg {
+ height: 16px;
+ width: 16px;
+
+ path {
+ fill: ${({ theme }) => theme.primaryBlue};
+ }
+ }
+
+ &:hover svg path {
+ fill: ${({ theme }) => theme.secondaryBlue};
+ }
+`;
diff --git a/web/src/components/Verdict/FinalDecision.tsx b/web/src/components/Verdict/FinalDecision.tsx
index bc0bcfc8b..c287284c7 100644
--- a/web/src/components/Verdict/FinalDecision.tsx
+++ b/web/src/components/Verdict/FinalDecision.tsx
@@ -2,7 +2,7 @@ import React, { useMemo } from "react";
import styled from "styled-components";
import Skeleton from "react-loading-skeleton";
-import { useNavigate, useParams } from "react-router-dom";
+import { useParams } from "react-router-dom";
import { useAccount } from "wagmi";
import ArrowIcon from "svgs/icons/arrow.svg";
@@ -19,11 +19,10 @@ import { useDisputeDetailsQuery } from "queries/useDisputeDetailsQuery";
import { responsiveSize } from "styles/responsiveSize";
-import LightButton from "../LightButton";
-
import AnswerDisplay from "./Answer";
import VerdictBanner from "./VerdictBanner";
import { Divider } from "../Divider";
+import { StyledArrowLink } from "../StyledArrowLink";
const Container = styled.div`
width: 100%;
@@ -45,16 +44,6 @@ const JuryDecisionTag = styled.small`
color: ${({ theme }) => theme.secondaryText};
`;
-const StyledButton = styled(LightButton)`
- display: flex;
- flex-direction: row-reverse;
- gap: 8px;
- > .button-text {
- color: ${({ theme }) => theme.primaryBlue};
- }
- padding-top: 0px;
-`;
-
const StyledDivider = styled(Divider)`
margin: ${responsiveSize(16, 32)} 0px;
`;
@@ -73,7 +62,6 @@ const FinalDecision: React.FC = ({ arbitrable }) => {
const localRounds = getLocalRounds(votingHistory?.dispute?.disputeKitDispute);
const ruled = disputeDetails?.dispute?.ruled ?? false;
const periodIndex = Periods[disputeDetails?.dispute?.period ?? "evidence"];
- const navigate = useNavigate();
const { data: currentRulingArray } = useReadKlerosCoreCurrentRuling({
query: { refetchInterval: REFETCH_INTERVAL },
args: [BigInt(id ?? 0)],
@@ -108,12 +96,9 @@ const FinalDecision: React.FC = ({ arbitrable }) => {
{isLoading && !isDisconnected ? (
) : (
- navigate(`/cases/${id?.toString()}/voting`)}
- text={buttonText}
- Icon={ArrowIcon}
- className="reverse-button"
- />
+
+ {buttonText}
+
)}
);
diff --git a/web/src/pages/Courts/CourtDetails/Description.tsx b/web/src/pages/Courts/CourtDetails/Description.tsx
index 5d30f358e..a808b3ddc 100644
--- a/web/src/pages/Courts/CourtDetails/Description.tsx
+++ b/web/src/pages/Courts/CourtDetails/Description.tsx
@@ -95,7 +95,7 @@ const Description: React.FC = () => {
{policy?.requiredSkills}
} />
- } />
+ 0 ? filteredTabs[0].path : ""} replace />} />
diff --git a/web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx b/web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx
index 4ff454167..6b53b480d 100644
--- a/web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx
+++ b/web/src/pages/Dashboard/Courts/CourtCard/CourtName.tsx
@@ -4,7 +4,8 @@ import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import ArrowIcon from "svgs/icons/arrow.svg";
-import { Link } from "react-router-dom";
+
+import { StyledArrowLink } from "components/StyledArrowLink";
const Container = styled.div`
display: flex;
@@ -20,24 +21,19 @@ const Container = styled.div`
}
${landscapeStyle(
- () =>
- css`
- justify-content: flex-start;
- width: auto;
- `
+ () => css`
+ justify-content: flex-start;
+ width: auto;
+ `
)}
`;
-const StyledLink = styled(Link)`
- display: flex;
- gap: 8px;
- align-items: center;
+const ReStyledArrowLink = styled(StyledArrowLink)`
+ font-size: 14px;
+
> svg {
height: 15px;
width: 15px;
- path {
- fill: ${({ theme }) => theme.primaryBlue};
- }
}
`;
@@ -50,9 +46,9 @@ const CourtName: React.FC = ({ name, id }) => {
return (
{name}
-
+
Open Court
-
+
);
};
diff --git a/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
index 6d2c68963..5ab94d883 100644
--- a/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
+++ b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
@@ -25,7 +25,7 @@ const StyledA = styled.a`
text-decoration: underline;
label {
cursor: pointer;
- color: ${({ theme }) => theme.primaryBlue};
+ color: ${({ theme }) => theme.secondaryBlue};
}
}
`;
diff --git a/web/src/styles/global-style.ts b/web/src/styles/global-style.ts
index cb5f5caa0..546ec90da 100644
--- a/web/src/styles/global-style.ts
+++ b/web/src/styles/global-style.ts
@@ -90,8 +90,13 @@ export const GlobalStyle = createGlobalStyle`
font-size: 14px;
text-decoration: none;
color: ${({ theme }) => theme.primaryBlue};
+ transition: color 0.1s;
}
-
+
+ a:hover {
+ color: ${({ theme }) => theme.secondaryBlue} !important;
+ }
+
hr {
opacity: 1;
border: 1px solid ${({ theme }) => theme.stroke};
From f745bf5254a0292eb134a6f9dcc80a1fceb1ad5d Mon Sep 17 00:00:00 2001
From: kemuru <102478601+kemuru@users.noreply.github.com>
Date: Mon, 2 Dec 2024 04:37:06 +0100
Subject: [PATCH 02/11] feat: more hover effects, style impros
---
.../components/DisputePreview/Policies.tsx | 20 ++--
web/src/components/EvidenceCard.tsx | 106 +++++++++++-------
web/src/components/HowItWorks.tsx | 25 ++---
web/src/components/ScrollTop.tsx | 23 +++-
web/src/consts/community-elements.tsx | 41 ++-----
web/src/layout/Header/navbar/Product.tsx | 3 +-
.../pages/Cases/AttachmentDisplay/Header.tsx | 8 ++
.../pages/Cases/AttachmentDisplay/index.tsx | 8 ++
.../Cases/CaseDetails/Evidence/index.tsx | 13 ++-
.../Voting/VotesDetails/AccordionTitle.tsx | 2 +-
.../pages/Courts/CourtDetails/Description.tsx | 13 ---
web/src/pages/Dashboard/JurorInfo/Header.tsx | 5 +-
web/src/pages/Home/Community/Element.tsx | 28 +++--
web/src/pages/Home/Community/index.tsx | 2 +-
web/src/utils/date.ts | 2 +-
15 files changed, 168 insertions(+), 131 deletions(-)
diff --git a/web/src/components/DisputePreview/Policies.tsx b/web/src/components/DisputePreview/Policies.tsx
index f30bce9ef..d5da3eaa8 100644
--- a/web/src/components/DisputePreview/Policies.tsx
+++ b/web/src/components/DisputePreview/Policies.tsx
@@ -41,12 +41,6 @@ const StyledP = styled.p`
)};
`;
-const StyledA = styled.a`
- display: flex;
- align-items: center;
- gap: 4px;
-`;
-
const StyledPolicyIcon = styled(PolicyIcon)`
width: 16px;
fill: ${({ theme }) => theme.primaryBlue};
@@ -67,6 +61,12 @@ const LinkContainer = styled.div`
const StyledLink = styled(Link)`
display: flex;
gap: 4px;
+
+ &:hover {
+ svg {
+ fill: ${({ theme }) => theme.secondaryBlue};
+ }
+ }
`;
type Attachment = {
@@ -85,10 +85,10 @@ export const Policies: React.FC = ({ disputePolicyURI, courtId, attac
Make sure you read and understand the Policies
{!isUndefined(attachment) && !isUndefined(attachment.uri) ? (
-
+
{attachment.label ?? "Attachment"}
-
+
) : null}
{isUndefined(disputePolicyURI) ? null : (
@@ -97,10 +97,10 @@ export const Policies: React.FC = ({ disputePolicyURI, courtId, attac
)}
{isUndefined(courtId) ? null : (
-
+
Court Policy
-
+
)}
diff --git a/web/src/components/EvidenceCard.tsx b/web/src/components/EvidenceCard.tsx
index 75eb614d8..e6d0fc0a0 100644
--- a/web/src/components/EvidenceCard.tsx
+++ b/web/src/components/EvidenceCard.tsx
@@ -54,7 +54,7 @@ const BottomShade = styled.div`
display: flex;
flex-wrap: wrap;
align-items: center;
- gap: 16px;
+ justify-content: space-between;
padding: 12px ${responsiveSize(8, 24)};
> * {
flex-basis: 1;
@@ -81,55 +81,81 @@ const AccountContainer = styled.div`
}
`;
-const DesktopText = styled.span`
- display: none;
+const LeftContent = styled.div`
+ display: block;
+
+ & > *:not(:last-child) {
+ margin-bottom: 8px;
+ }
+
${landscapeStyle(
() => css`
- display: inline;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+ gap: 0 12px;
+
+ & > *:not(:last-child) {
+ margin-bottom: 0;
+ }
`
)}
`;
+const HoverStyle = css`
+ :hover {
+ text-decoration: underline;
+ color: ${({ theme }) => theme.secondaryBlue};
+ cursor: pointer;
+ }
+`;
+
+const Address = styled.p`
+ ${HoverStyle}
+ margin: 0;
+`;
+
const Timestamp = styled.label`
color: ${({ theme }) => theme.secondaryText};
+ ${HoverStyle}
`;
-const MobileText = styled.span`
+const DesktopText = styled.span`
+ display: none;
${landscapeStyle(
() => css`
- display: none;
+ display: inline;
`
)}
`;
-const StyledLink = styled(Link)`
- height: fit-content;
- display: flex;
- margin-left: auto;
- gap: ${responsiveSize(5, 6)};
+const MobileText = styled.span`
${landscapeStyle(
() => css`
- > svg {
- width: 16px;
- fill: ${({ theme }) => theme.primaryBlue};
- }
+ display: none;
`
)}
`;
-const StyledA = styled.a`
- :hover {
- text-decoration: underline;
- p {
- color: ${({ theme }) => theme.primaryBlue};
- }
- label {
- cursor: pointer;
- color: ${({ theme }) => theme.primaryBlue};
- }
+const StyledLink = styled(Link)`
+ display: flex;
+ gap: ${responsiveSize(5, 6)};
+ > svg {
+ width: 16px;
+ fill: ${({ theme }) => theme.primaryBlue};
+ }
+
+ :hover svg {
+ transition: fill 0.1s;
+ fill: ${({ theme }) => theme.secondaryBlue};
}
`;
+const FileLinkContainer = styled.div`
+ margin-left: auto;
+`;
+
const AttachedFileText: React.FC = () => (
<>
View attached file
@@ -175,20 +201,24 @@ const EvidenceCard: React.FC = ({
)}
-
-
-
- {shortenAddress(sender)}
-
-
-
- {formatDate(Number(timestamp), true)}
-
- {fileURI && fileURI !== "-" ? (
-
-
-
+
+
+
+
+ {shortenAddress(sender)}
+
+
+
+ {formatDate(Number(timestamp), true)}
+
+ {fileURI && fileURI !== "-" ? (
+
+
+
+
+
+
) : null}
diff --git a/web/src/components/HowItWorks.tsx b/web/src/components/HowItWorks.tsx
index 1e6651e5d..6d629f791 100644
--- a/web/src/components/HowItWorks.tsx
+++ b/web/src/components/HowItWorks.tsx
@@ -6,29 +6,26 @@ import BookOpenIcon from "svgs/icons/book-open.svg";
const Container = styled.div`
display: flex;
align-items: center;
+ font-size: 14px;
+ font-weight: 400;
gap: 8px;
+ cursor: pointer;
color: ${({ theme }) => theme.primaryBlue};
+ transition: color 0.1s;
- &,
- & * {
- cursor: pointer;
+ svg path {
+ fill: ${({ theme }) => theme.primaryBlue};
+ transition: fill 0.1s;
}
&:hover {
- text-decoration: underline;
- }
-
- svg {
- path {
- fill: ${({ theme }) => theme.primaryBlue};
+ color: ${({ theme }) => theme.secondaryBlue};
+ svg path {
+ fill: ${({ theme }) => theme.secondaryBlue};
}
}
`;
-const StyledLabel = styled.label`
- color: ${({ theme }) => theme.primaryBlue};
-`;
-
interface IHowItWorks {
isMiniGuideOpen: boolean;
toggleMiniGuide: () => void;
@@ -40,7 +37,7 @@ const HowItWorks: React.FC = ({ isMiniGuideOpen, toggleMiniGuide, M
<>
- How it works
+ How it works
{isMiniGuideOpen && }
>
diff --git a/web/src/components/ScrollTop.tsx b/web/src/components/ScrollTop.tsx
index 5a1732c72..08bd9e228 100644
--- a/web/src/components/ScrollTop.tsx
+++ b/web/src/components/ScrollTop.tsx
@@ -1,14 +1,33 @@
-import React, { useEffect } from "react";
+import React, { useEffect, useRef } from "react";
+import { useLocation, useNavigate } from "react-router-dom";
import { useScrollTop } from "hooks/useScrollTop";
const ScrollTop: React.FC = () => {
const scrollTop = useScrollTop();
+ const { search, pathname } = useLocation();
+ const navigate = useNavigate();
+ const hasScrolled = useRef(false);
useEffect(() => {
+ if (hasScrolled.current) return;
+ const params = new URLSearchParams(search);
+ const section = params.get("section");
+
+ if (section) {
+ const targetElement = document.getElementById(section);
+ if (targetElement) {
+ targetElement.scrollIntoView({ behavior: "smooth" });
+ hasScrolled.current = true;
+ navigate(pathname, { replace: true });
+ return;
+ }
+ }
+
scrollTop();
}, []);
- return <>>;
+ return null;
};
+
export default ScrollTop;
diff --git a/web/src/consts/community-elements.tsx b/web/src/consts/community-elements.tsx
index e5918fd46..1189e8d70 100644
--- a/web/src/consts/community-elements.tsx
+++ b/web/src/consts/community-elements.tsx
@@ -1,4 +1,3 @@
-import React from "react";
import styled, { css } from "styled-components";
import FrenchFlagIcon from "svgs/icons/french-flag.svg";
@@ -8,13 +7,6 @@ import TelegramIcon from "svgs/socialmedia/telegram.svg";
import { IElement } from "../pages/Home/Community/Element";
-const StyledLabel = styled.label`
- color: ${({ theme }) => theme.primaryBlue};
- :hover {
- cursor: pointer;
- }
-`;
-
const fillWithSecondaryPurple = css`
fill: ${({ theme }) => theme.secondaryPurple};
`;
@@ -34,39 +26,24 @@ const StyledTelegramIcon = styled(TelegramIcon)`
export const section: IElement[] = [
{
Icon: StyledPNKIcon,
- urls: [
- {
- node: Kleros Forum,
- link: "https://forum.kleros.io/",
- },
- ],
+ title: "Kleros Forum",
+ link: "https://forum.kleros.io/",
},
+
{
Icon: SnapshotIcon,
- urls: [
- {
- node: Vote on proposals,
- link: "https://snapshot.org/#/kleros.eth/",
- },
- ],
+ title: "Vote on proposals",
+ link: "https://snapshot.org/#/kleros.eth/",
},
{
Icon: StyledTelegramIcon,
+ title: "Community Calls",
+ link: "https://t.me/kleros",
primaryText: "Wednesday, 18h UTC",
- urls: [
- {
- node: Community Calls,
- link: "https://t.me/kleros",
- },
- ],
},
{
Icon: FrenchFlagIcon,
- urls: [
- {
- node: Join the Coopérative,
- link: "https://kleros.io/coop/",
- },
- ],
+ title: "Join the Coopérative",
+ link: "https://kleros.io/coop/",
},
];
diff --git a/web/src/layout/Header/navbar/Product.tsx b/web/src/layout/Header/navbar/Product.tsx
index ec866320e..bcd1d4e0d 100644
--- a/web/src/layout/Header/navbar/Product.tsx
+++ b/web/src/layout/Header/navbar/Product.tsx
@@ -13,8 +13,7 @@ const Container = styled.a`
border-radius: 3px;
:hover {
transform: scale(1.05);
- transition: 350ms;
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
+ transition: 0.1s;
}
gap: 8px;
width: ${responsiveSize(100, 130)};
diff --git a/web/src/pages/Cases/AttachmentDisplay/Header.tsx b/web/src/pages/Cases/AttachmentDisplay/Header.tsx
index 98faa738b..dc6a3bd67 100644
--- a/web/src/pages/Cases/AttachmentDisplay/Header.tsx
+++ b/web/src/pages/Cases/AttachmentDisplay/Header.tsx
@@ -53,6 +53,14 @@ const StyledButton = styled(Button)`
:focus,
:hover {
background-color: transparent;
+ .button-svg {
+ path {
+ fill: ${({ theme }) => theme.secondaryBlue};
+ }
+ }
+ .button-text {
+ color: ${({ theme }) => theme.secondaryBlue};
+ }
}
`;
diff --git a/web/src/pages/Cases/AttachmentDisplay/index.tsx b/web/src/pages/Cases/AttachmentDisplay/index.tsx
index e844294db..4f72f40b0 100644
--- a/web/src/pages/Cases/AttachmentDisplay/index.tsx
+++ b/web/src/pages/Cases/AttachmentDisplay/index.tsx
@@ -30,6 +30,14 @@ const NewTabInfo = styled.a`
display: flex;
gap: 8px;
align-items: center;
+
+ :hover {
+ text-decoration: underline;
+ svg path {
+ transition: fill 0.1s;
+ fill: ${({ theme }) => theme.secondaryBlue};
+ }
+ }
`;
const StyledNewTabIcon = styled(NewTabIcon)`
diff --git a/web/src/pages/Cases/CaseDetails/Evidence/index.tsx b/web/src/pages/Cases/CaseDetails/Evidence/index.tsx
index 488893801..d3c6173ae 100644
--- a/web/src/pages/Cases/CaseDetails/Evidence/index.tsx
+++ b/web/src/pages/Cases/CaseDetails/Evidence/index.tsx
@@ -49,10 +49,21 @@ const ScrollButton = styled(Button)`
}
.button-svg {
margin: 0;
+ path {
+ fill: ${({ theme }) => theme.primaryBlue};
+ }
}
- :focus,
+
:hover {
background-color: transparent;
+ .button-svg {
+ path {
+ fill: ${({ theme }) => theme.secondaryBlue};
+ }
+ }
+ .button-text {
+ color: ${({ theme }) => theme.secondaryBlue};
+ }
}
`;
diff --git a/web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx b/web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx
index 4eaed0799..305c97ff1 100644
--- a/web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx
+++ b/web/src/pages/Cases/CaseDetails/Voting/VotesDetails/AccordionTitle.tsx
@@ -46,7 +46,7 @@ const StyledA = styled.a`
text-decoration: underline;
label {
cursor: pointer;
- color: ${({ theme }) => theme.primaryBlue};
+ color: ${({ theme }) => theme.secondaryBlue};
}
}
`;
diff --git a/web/src/pages/Courts/CourtDetails/Description.tsx b/web/src/pages/Courts/CourtDetails/Description.tsx
index a808b3ddc..bec214d5e 100644
--- a/web/src/pages/Courts/CourtDetails/Description.tsx
+++ b/web/src/pages/Courts/CourtDetails/Description.tsx
@@ -67,19 +67,6 @@ const Description: React.FC = () => {
const filteredTabs = TABS.filter(({ isVisible }) => isVisible(policy));
- const location = useLocation();
- const queryParams = new URLSearchParams(location.search);
- const scrollToSection = queryParams.get("section");
-
- useEffect(() => {
- if (scrollToSection === "description") {
- const element = document.getElementById(scrollToSection);
- if (element) {
- element.scrollIntoView({ behavior: "smooth" });
- }
- }
- }, [scrollToSection]);
-
return (
theme.primaryBlue};
width: 16px;
height: 16px;
+ fill: ${({ theme }) => theme.primaryBlue};
`;
const StyledLink = styled.a`
@@ -59,6 +59,9 @@ const StyledLink = styled.a`
&:hover {
text-decoration: underline;
+ svg {
+ fill: ${({ theme }) => theme.secondaryBlue};
+ }
}
`;
diff --git a/web/src/pages/Home/Community/Element.tsx b/web/src/pages/Home/Community/Element.tsx
index 31426ce04..283262267 100644
--- a/web/src/pages/Home/Community/Element.tsx
+++ b/web/src/pages/Home/Community/Element.tsx
@@ -11,11 +11,6 @@ const Container = styled.div`
width: 16px;
height: 16px;
}
-
- .link-container {
- display: flex;
- gap: 8px;
- }
`;
const StyledLabel = styled.label`
@@ -26,24 +21,27 @@ const StyledLabel = styled.label`
const StyledA = styled.a`
display: flex;
align-items: center;
+ gap: 8px;
+
+ &:hover {
+ text-decoration: underline;
+ }
`;
export interface IElement {
- primaryText?: string;
- urls: { node: React.ReactNode; link: string }[];
Icon?: React.FC>;
+ title: string;
+ link: string;
+ primaryText?: string;
}
-export const Element: React.FC = ({ primaryText, urls, Icon }) => (
+export const Element: React.FC = ({ primaryText, title, link, Icon }) => (
- {Icon && }
-
- {urls.map(({ node, link }) => (
-
- {node}
-
- ))}
+
+ {Icon && }
+ {title}
+
{primaryText && {primaryText}}
diff --git a/web/src/pages/Home/Community/index.tsx b/web/src/pages/Home/Community/index.tsx
index 58553aaec..0c2cf8547 100644
--- a/web/src/pages/Home/Community/index.tsx
+++ b/web/src/pages/Home/Community/index.tsx
@@ -59,7 +59,7 @@ const Community = () => (
{section.slice(0, 3).map((element) => (
-
+
))}
diff --git a/web/src/utils/date.ts b/web/src/utils/date.ts
index 15a1c6c89..3320083be 100644
--- a/web/src/utils/date.ts
+++ b/web/src/utils/date.ts
@@ -24,7 +24,7 @@ export function formatDate(unixTimestamp: number, withTime = false): string {
const date = new Date(unixTimestamp * 1000);
const options: Intl.DateTimeFormatOptions = withTime
? {
- month: "long",
+ month: "short",
day: "2-digit",
year: "numeric",
hour: "numeric",
From 9985f0b15389e7b670d141c1a61a3baecd2de542 Mon Sep 17 00:00:00 2001
From: kemuru <102478601+kemuru@users.noreply.github.com>
Date: Tue, 3 Dec 2024 14:56:27 +0100
Subject: [PATCH 03/11] feat: bug fixes, more hover effects
---
.../ConnectWallet/AccountDisplay.tsx | 17 +++++++-
.../components/DisputePreview/Policies.tsx | 19 +++++----
.../DisputeView/DisputeCardView.tsx | 2 +-
.../DisputeView/DisputeListView.tsx | 2 +-
web/src/components/EvidenceCard.tsx | 24 ++++++-----
web/src/components/ExternalLink.tsx | 8 ++++
web/src/components/Field.tsx | 13 ++----
web/src/components/InternalLink.tsx | 8 ++++
web/src/components/LightButton.tsx | 27 +++++++++---
.../Popup/MiniGuides/JurorLevels.tsx | 4 +-
web/src/components/StyledArrowLink.tsx | 8 +++-
web/src/layout/Header/DesktopHeader.tsx | 18 ++------
web/src/layout/Header/Logo.tsx | 11 ++++-
web/src/layout/Header/navbar/DappList.tsx | 18 ++++----
web/src/layout/Header/navbar/Explore.tsx | 41 +++++++++----------
web/src/layout/Header/navbar/Menu/Help.tsx | 5 +--
web/src/layout/Header/navbar/Menu/index.tsx | 10 -----
web/src/layout/Header/navbar/Product.tsx | 27 ++++++++----
web/src/layout/Header/navbar/index.tsx | 1 -
.../pages/Cases/AttachmentDisplay/index.tsx | 23 ++++-------
web/src/pages/Dashboard/JurorInfo/Header.tsx | 14 ++-----
web/src/pages/Home/Community/Element.tsx | 10 ++---
.../Home/TopJurors/JurorCard/JurorTitle.tsx | 13 +++---
web/src/styles/global-style.ts | 5 +--
web/src/styles/themes.ts | 6 ++-
25 files changed, 178 insertions(+), 156 deletions(-)
create mode 100644 web/src/components/ExternalLink.tsx
create mode 100644 web/src/components/InternalLink.tsx
diff --git a/web/src/components/ConnectWallet/AccountDisplay.tsx b/web/src/components/ConnectWallet/AccountDisplay.tsx
index 2a415237a..bc44bafc7 100644
--- a/web/src/components/ConnectWallet/AccountDisplay.tsx
+++ b/web/src/components/ConnectWallet/AccountDisplay.tsx
@@ -21,10 +21,22 @@ const Container = styled.div`
align-items: center;
background-color: ${({ theme }) => theme.whiteBackground};
padding: 0px;
+ cursor: pointer;
+
+ &:hover {
+ label {
+ color: ${({ theme }) => theme.white} !important;
+ transition: color 0.2s;
+ }
+ }
${landscapeStyle(
() => css`
- background-color: ${({ theme }) => theme.whiteLowOpacity};
+ background-color: ${({ theme }) => theme.whiteLowOpacitySubtle};
+ &:hover {
+ transition: background-color 0.1s;
+ background-color: ${({ theme }) => theme.whiteLowOpacityStrong};
+ }
flex-direction: row;
align-content: center;
border-radius: 300px;
@@ -50,13 +62,14 @@ const AccountContainer = styled.div`
() => css`
gap: 12px;
> label {
- color: ${({ theme }) => theme.primaryText};
+ color: ${({ theme }) => theme.white}CC !important;
font-weight: 400;
font-size: 14px;
}
`
)}
`;
+
const ChainConnectionContainer = styled.div`
display: flex;
width: fit-content;
diff --git a/web/src/components/DisputePreview/Policies.tsx b/web/src/components/DisputePreview/Policies.tsx
index d5da3eaa8..6ade8eb00 100644
--- a/web/src/components/DisputePreview/Policies.tsx
+++ b/web/src/components/DisputePreview/Policies.tsx
@@ -1,8 +1,6 @@
import React from "react";
import styled, { css } from "styled-components";
-import { Link } from "react-router-dom";
-
import PaperclipIcon from "svgs/icons/paperclip.svg";
import PolicyIcon from "svgs/icons/policy.svg";
@@ -12,6 +10,8 @@ import { isUndefined } from "utils/index";
import { landscapeStyle } from "styles/landscapeStyle";
import { responsiveSize } from "styles/responsiveSize";
+import { InternalLink } from "components/InternalLink";
+
const ShadeArea = styled.div`
display: flex;
flex-direction: column;
@@ -58,12 +58,13 @@ const LinkContainer = styled.div`
align-items: center;
`;
-const StyledLink = styled(Link)`
+const StyledInternalLink = styled(InternalLink)`
display: flex;
gap: 4px;
&:hover {
svg {
+ transition: fill 0.1s;
fill: ${({ theme }) => theme.secondaryBlue};
}
}
@@ -85,22 +86,22 @@ export const Policies: React.FC = ({ disputePolicyURI, courtId, attac
Make sure you read and understand the Policies
{!isUndefined(attachment) && !isUndefined(attachment.uri) ? (
-
+
{attachment.label ?? "Attachment"}
-
+
) : null}
{isUndefined(disputePolicyURI) ? null : (
-
+
Dispute Policy
-
+
)}
{isUndefined(courtId) ? null : (
-
+
Court Policy
-
+
)}
diff --git a/web/src/components/DisputeView/DisputeCardView.tsx b/web/src/components/DisputeView/DisputeCardView.tsx
index fbc489e6d..2c2e370a3 100644
--- a/web/src/components/DisputeView/DisputeCardView.tsx
+++ b/web/src/components/DisputeView/DisputeCardView.tsx
@@ -22,7 +22,7 @@ const StyledCard = styled(Card)`
transition: background-color 0.1s;
&:hover {
- background-color: ${({ theme }) => theme.lightGrey};
+ background-color: ${({ theme }) => theme.lightGrey}BB;
}
`;
diff --git a/web/src/components/DisputeView/DisputeListView.tsx b/web/src/components/DisputeView/DisputeListView.tsx
index 9504a5e15..cdd4e64c3 100644
--- a/web/src/components/DisputeView/DisputeListView.tsx
+++ b/web/src/components/DisputeView/DisputeListView.tsx
@@ -21,7 +21,7 @@ const StyledListItem = styled(Card)`
transition: background-color 0.1s;
&:hover {
- background-color: ${({ theme }) => theme.lightGrey};
+ background-color: ${({ theme }) => theme.lightGrey}BB;
}
`;
diff --git a/web/src/components/EvidenceCard.tsx b/web/src/components/EvidenceCard.tsx
index e6d0fc0a0..f561cbd70 100644
--- a/web/src/components/EvidenceCard.tsx
+++ b/web/src/components/EvidenceCard.tsx
@@ -1,9 +1,11 @@
import React, { useMemo } from "react";
import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+import { responsiveSize } from "styles/responsiveSize";
+
import Identicon from "react-identicons";
import ReactMarkdown from "react-markdown";
-import { Link } from "react-router-dom";
import { Card } from "@kleros/ui-components-library";
@@ -16,8 +18,8 @@ import { shortenAddress } from "utils/shortenAddress";
import { type Evidence } from "src/graphql/graphql";
-import { landscapeStyle } from "styles/landscapeStyle";
-import { responsiveSize } from "styles/responsiveSize";
+import { ExternalLink } from "./ExternalLink";
+import { InternalLink } from "./InternalLink";
const StyledCard = styled(Card)`
width: 100%;
@@ -106,7 +108,7 @@ const LeftContent = styled.div`
const HoverStyle = css`
:hover {
text-decoration: underline;
- color: ${({ theme }) => theme.secondaryBlue};
+ color: ${({ theme }) => theme.primaryBlue};
cursor: pointer;
}
`;
@@ -138,7 +140,7 @@ const MobileText = styled.span`
)}
`;
-const StyledLink = styled(Link)`
+const StyledInternalLink = styled(InternalLink)`
display: flex;
gap: ${responsiveSize(5, 6)};
> svg {
@@ -204,20 +206,20 @@ const EvidenceCard: React.FC = ({
-
+
{shortenAddress(sender)}
-
+
-
+
{formatDate(Number(timestamp), true)}
-
+
{fileURI && fileURI !== "-" ? (
-
+
-
+
) : null}
diff --git a/web/src/components/ExternalLink.tsx b/web/src/components/ExternalLink.tsx
new file mode 100644
index 000000000..f85920a1a
--- /dev/null
+++ b/web/src/components/ExternalLink.tsx
@@ -0,0 +1,8 @@
+import { Link } from "react-router-dom";
+import styled from "styled-components";
+
+export const ExternalLink = styled(Link)`
+ :hover {
+ text-decoration: underline;
+ }
+`;
diff --git a/web/src/components/Field.tsx b/web/src/components/Field.tsx
index d407d82c3..1bf44717c 100644
--- a/web/src/components/Field.tsx
+++ b/web/src/components/Field.tsx
@@ -2,7 +2,7 @@ import React from "react";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
-import { Link } from "react-router-dom";
+import { InternalLink } from "./InternalLink";
const FieldContainer = styled.div`
display: flex;
@@ -58,14 +58,9 @@ const FieldContainer = styled.div`
const LinkContainer = styled.div``;
-const StyledLink = styled(Link)`
- color: ${({ theme }) => theme.primaryBlue};
+const StyledInternalLink = styled(InternalLink)`
text-wrap: auto;
justify-content: end;
-
- &:hover {
- text-decoration: underline ${({ theme }) => theme.secondaryBlue};
- }
`;
type FieldContainerProps = {
@@ -104,14 +99,14 @@ const Field: React.FC = ({
{(!displayAsList || isOverview || isJurorBalance) && }
{link ? (
- {
event.stopPropagation();
}}
>
{value}
-
+
) : (
diff --git a/web/src/components/InternalLink.tsx b/web/src/components/InternalLink.tsx
new file mode 100644
index 000000000..2025427b3
--- /dev/null
+++ b/web/src/components/InternalLink.tsx
@@ -0,0 +1,8 @@
+import { Link } from "react-router-dom";
+import styled from "styled-components";
+
+export const InternalLink = styled(Link)`
+ :hover {
+ color: ${({ theme }) => theme.secondaryBlue} !important;
+ }
+`;
diff --git a/web/src/components/LightButton.tsx b/web/src/components/LightButton.tsx
index 273d48352..ff8f28e78 100644
--- a/web/src/components/LightButton.tsx
+++ b/web/src/components/LightButton.tsx
@@ -1,23 +1,38 @@
import React from "react";
-import styled from "styled-components";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
import { Button } from "@kleros/ui-components-library";
const StyledButton = styled(Button)`
background-color: transparent;
- padding-left: 0;
+ padding: 8px 8px 8px 0 !important;
+ border-radius: 7px;
.button-text {
color: ${({ theme }) => theme.primaryText};
font-weight: 400;
}
.button-svg {
- fill: ${({ theme }) => theme.secondaryPurple};
+ margin-right: 8px;
+ fill: ${({ theme }) => theme.white}BF !important;
}
- :focus,
- :hover {
- background-color: transparent;
+ &:hover {
+ .button-svg {
+ fill: ${({ theme }) => theme.white} !important;
+ }
+ transition: background-color 0.1s;
+ background-color: ${({ theme }) => theme.whiteLowOpacityStrong};
}
+
+ ${landscapeStyle(
+ () => css`
+ padding: 8px !important;
+ .button-svg {
+ margin-right: 0;
+ }
+ `
+ )}
`;
interface ILightButton {
diff --git a/web/src/components/Popup/MiniGuides/JurorLevels.tsx b/web/src/components/Popup/MiniGuides/JurorLevels.tsx
index 6d1083211..411be1f09 100644
--- a/web/src/components/Popup/MiniGuides/JurorLevels.tsx
+++ b/web/src/components/Popup/MiniGuides/JurorLevels.tsx
@@ -32,7 +32,7 @@ const Card = styled(_Card)`
const leftPageContents = [
{
- title: "Juror Level 1: Phytagoras",
+ title: "Juror Level 1: Pythagoras",
paragraphs: [
"Jurors are classified into distinct levels according to their performance starting from Level 1.",
"Level 1: Jurors with 0 cases arbitrated, OR Jurors with ≥ 1 case arbitrated with 0-70% of coherent votes.",
@@ -62,7 +62,7 @@ const leftPageContents = [
const userLevelData = [
{
level: 1,
- title: "Phytagoras",
+ title: "Pythagoras",
totalCoherentVotes: 6,
totalResolvedVotes: 10,
},
diff --git a/web/src/components/StyledArrowLink.tsx b/web/src/components/StyledArrowLink.tsx
index 3d7a7abf2..5a69e4b7d 100644
--- a/web/src/components/StyledArrowLink.tsx
+++ b/web/src/components/StyledArrowLink.tsx
@@ -17,7 +17,11 @@ export const StyledArrowLink = styled(Link)`
}
}
- &:hover svg path {
- fill: ${({ theme }) => theme.secondaryBlue};
+ &:hover {
+ color: ${({ theme }) => theme.secondaryBlue};
+ svg path {
+ transition: fill 0.1s;
+ fill: ${({ theme }) => theme.secondaryBlue};
+ }
}
`;
diff --git a/web/src/layout/Header/DesktopHeader.tsx b/web/src/layout/Header/DesktopHeader.tsx
index fc889ccda..ac17f602f 100644
--- a/web/src/layout/Header/DesktopHeader.tsx
+++ b/web/src/layout/Header/DesktopHeader.tsx
@@ -48,6 +48,7 @@ const Container = styled.div`
const LeftSide = styled.div`
display: flex;
+ gap: 8px;
`;
const MiddleSide = styled.div`
@@ -56,12 +57,11 @@ const MiddleSide = styled.div`
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
- color: ${({ theme }) => theme.white} !important;
`;
const RightSide = styled.div`
display: flex;
- gap: ${responsiveSize(8, 16, 300, 1024)};
+ gap: ${responsiveSize(4, 8)};
margin-left: 8px;
canvas {
@@ -72,9 +72,6 @@ const RightSide = styled.div`
const LightButtonContainer = styled.div`
display: flex;
align-items: center;
- width: 16px;
- margin-left: ${responsiveSize(4, 8)};
- margin-right: ${responsiveSize(12, 16)};
`;
const StyledKlerosSolutionsIcon = styled(KlerosSolutionsIcon)`
@@ -84,17 +81,8 @@ const StyledKlerosSolutionsIcon = styled(KlerosSolutionsIcon)`
const ConnectWalletContainer = styled.div<{ isConnected: boolean; isDefaultChain: boolean }>`
label {
color: ${({ theme }) => theme.white};
+ cursor: pointer;
}
-
- ${({ isConnected, isDefaultChain }) =>
- isConnected &&
- isDefaultChain &&
- css`
- cursor: pointer;
- & > * {
- pointer-events: none;
- }
- `}
`;
const PopupContainer = styled.div`
diff --git a/web/src/layout/Header/Logo.tsx b/web/src/layout/Header/Logo.tsx
index 2d94cf174..730121153 100644
--- a/web/src/layout/Header/Logo.tsx
+++ b/web/src/layout/Header/Logo.tsx
@@ -31,6 +31,15 @@ const BadgeText = styled.label`
color: ${({ theme }) => theme.darkPurple};
`;
+const StyledKlerosCourtLogo = styled(KlerosCourtLogo)`
+ &:hover {
+ path {
+ fill: ${({ theme }) => theme.white}BF;
+ transition: fill 0.1s;
+ }
+ }
+`;
+
const CourtBadge: React.FC = () => {
const { text, color } = useMemo<{ text?: string; color?: keyof Theme }>(() => {
switch (getArbitratorType()) {
@@ -53,7 +62,7 @@ const Logo: React.FC = () => (
{" "}
-
+
diff --git a/web/src/layout/Header/navbar/DappList.tsx b/web/src/layout/Header/navbar/DappList.tsx
index 9c1db313d..c6fa55ec3 100644
--- a/web/src/layout/Header/navbar/DappList.tsx
+++ b/web/src/layout/Header/navbar/DappList.tsx
@@ -16,14 +16,6 @@ import { responsiveSize } from "styles/responsiveSize";
import Product from "./Product";
-const Header = styled.h1`
- padding-top: 32px;
- padding-bottom: 20px;
- font-size: 24px;
- font-weight: 600;
- line-height: 32.68px;
-`;
-
const Container = styled.div`
display: flex;
position: absolute;
@@ -37,7 +29,6 @@ const Container = styled.div`
width: 86vw;
max-width: 480px;
- min-width: 300px;
border-radius: 3px;
border: 1px solid ${({ theme }) => theme.stroke};
background-color: ${({ theme }) => theme.whiteBackground};
@@ -60,10 +51,17 @@ const Container = styled.div`
)}
`;
+const Header = styled.h1`
+ padding-top: 24px;
+ font-size: 24px;
+ font-weight: 600;
+ line-height: 32.68px;
+`;
+
const ItemsDiv = styled.div`
display: grid;
overflow-y: auto;
- padding: 16px ${responsiveSize(8, 24, 480)};
+ padding: 4px ${responsiveSize(8, 24)} 16px ${responsiveSize(8, 24)};
row-gap: 8px;
column-gap: 2px;
justify-items: center;
diff --git a/web/src/layout/Header/navbar/Explore.tsx b/web/src/layout/Header/navbar/Explore.tsx
index b3f597dc9..5b9321928 100644
--- a/web/src/layout/Header/navbar/Explore.tsx
+++ b/web/src/layout/Header/navbar/Explore.tsx
@@ -4,31 +4,24 @@ import styled, { css } from "styled-components";
import { Link, useLocation } from "react-router-dom";
import { landscapeStyle } from "styles/landscapeStyle";
-import { responsiveSize } from "styles/responsiveSize";
import { useOpenContext } from "../MobileHeader";
const Container = styled.div`
display: flex;
- gap: 0px;
+ gap: 0;
flex-direction: column;
${landscapeStyle(
() => css`
flex-direction: row;
- gap: ${responsiveSize(4, 16)};
`
)};
`;
-const LinkContainer = styled.div`
- display: flex;
- min-height: 32px;
- align-items: center;
-`;
-
const Title = styled.h1`
display: block;
+ margin-bottom: 8px;
${landscapeStyle(
() => css`
@@ -38,15 +31,22 @@ const Title = styled.h1`
`;
const StyledLink = styled(Link)<{ isActive: boolean }>`
- color: ${({ theme }) => theme.primaryText};
+ display: flex;
+ align-items: center;
text-decoration: none;
font-size: 16px;
+ color: ${({ isActive, theme }) => (isActive ? theme.primaryText : `${theme.primaryText}BA`)};
+ padding: 8px 8px 8px 0;
+ border-radius: 7px;
- font-weight: ${({ isActive }) => (isActive ? "600" : "normal")};
+ &:hover {
+ color: ${({ theme }) => theme.white} !important;
+ }
${landscapeStyle(
() => css`
- color: ${({ theme }) => theme.white};
+ color: ${({ isActive, theme }) => (isActive ? theme.white : `${theme.white}BA`)};
+ padding: 16px 8px;
`
)};
`;
@@ -67,15 +67,14 @@ const Explore: React.FC = () => {
Explore
{links.map(({ to, text }) => (
-
-
- {text}
-
-
+
+ {text}
+
))}
);
diff --git a/web/src/layout/Header/navbar/Menu/Help.tsx b/web/src/layout/Header/navbar/Menu/Help.tsx
index 0cc502aca..3e242718a 100644
--- a/web/src/layout/Header/navbar/Menu/Help.tsx
+++ b/web/src/layout/Header/navbar/Menu/Help.tsx
@@ -57,10 +57,7 @@ const ListItem = styled.a`
padding: 0px 8px;
cursor: pointer;
:hover {
- transform: scale(1.02) translateZ(0);
- transition: 200ms;
- transition-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
- backface-visibility: hidden;
+ transform: scale(1.02);
}
small {
diff --git a/web/src/layout/Header/navbar/Menu/index.tsx b/web/src/layout/Header/navbar/Menu/index.tsx
index 93d8a83ab..3da8d3853 100644
--- a/web/src/layout/Header/navbar/Menu/index.tsx
+++ b/web/src/layout/Header/navbar/Menu/index.tsx
@@ -17,14 +17,11 @@ import { IHelp, ISettings } from "..";
const Container = styled.div`
display: flex;
-
flex-direction: column;
- gap: 0px;
${landscapeStyle(
() => css`
flex-direction: row;
- gap: 8px;
`
)}
`;
@@ -42,15 +39,8 @@ const ButtonContainer = styled.div`
display: block;
}
- .button-svg {
- fill: ${({ theme }) => theme.secondaryPurple};
- }
-
${landscapeStyle(
() => css`
- .button-svg {
- fill: ${({ theme }) => theme.white};
- }
.button-text {
display: none;
}
diff --git a/web/src/layout/Header/navbar/Product.tsx b/web/src/layout/Header/navbar/Product.tsx
index bcd1d4e0d..269383068 100644
--- a/web/src/layout/Header/navbar/Product.tsx
+++ b/web/src/layout/Header/navbar/Product.tsx
@@ -1,5 +1,6 @@
-import React from "react";
+import React, { useState } from "react";
import styled from "styled-components";
+import Skeleton from "react-loading-skeleton";
import { responsiveSize } from "styles/responsiveSize";
@@ -8,16 +9,18 @@ const Container = styled.a`
display: flex;
flex-direction: column;
align-items: center;
- padding: 20px 8px 35px 8px;
+ padding: 16px 8px 28px 8px;
max-width: 100px;
border-radius: 3px;
:hover {
- transform: scale(1.05);
- transition: 0.1s;
+ transition:
+ transform 0.15s,
+ background-color 0.3s;
+ transform: scale(1.02);
+ background-color: ${({ theme }) => theme.lightGrey};
}
gap: 8px;
width: ${responsiveSize(100, 130)};
-
background-color: ${({ theme }) => theme.lightBackground};
`;
@@ -26,9 +29,10 @@ const StyledIcon = styled.svg`
height: 48px;
`;
-const StyledImg = styled.img`
+const StyledImg = styled.img<{ isLoaded: boolean }>`
width: 48px;
height: 48px;
+ display: ${({ isLoaded }) => (isLoaded ? "block" : "none")};
`;
const StyledSmall = styled.small`
@@ -45,9 +49,18 @@ interface IProduct {
}
const Product: React.FC = ({ text, url, Icon }) => {
+ const [isImgLoaded, setIsImgLoaded] = useState(false);
+
return (
- {typeof Icon === "string" ? : }
+ {typeof Icon === "string" ? (
+ <>
+ {!isImgLoaded ? : null}
+ setIsImgLoaded(true)} />
+ >
+ ) : (
+
+ )}
{text}
);
diff --git a/web/src/layout/Header/navbar/index.tsx b/web/src/layout/Header/navbar/index.tsx
index c47c12601..a2caa7174 100644
--- a/web/src/layout/Header/navbar/index.tsx
+++ b/web/src/layout/Header/navbar/index.tsx
@@ -44,7 +44,6 @@ const Container = styled.div<{ isOpen: boolean }>`
overflow-y: auto;
z-index: 1;
background-color: ${({ theme }) => theme.whiteBackground};
- border: 1px solid ${({ theme }) => theme.stroke};
box-shadow: 0px 2px 3px ${({ theme }) => theme.defaultShadow};
transform-origin: top;
transform: scaleY(${({ isOpen }) => (isOpen ? "1" : "0")});
diff --git a/web/src/pages/Cases/AttachmentDisplay/index.tsx b/web/src/pages/Cases/AttachmentDisplay/index.tsx
index 4f72f40b0..5259c14f2 100644
--- a/web/src/pages/Cases/AttachmentDisplay/index.tsx
+++ b/web/src/pages/Cases/AttachmentDisplay/index.tsx
@@ -7,37 +7,30 @@ import NewTabIcon from "svgs/icons/new-tab.svg";
import Loader from "components/Loader";
import ScrollTop from "components/ScrollTop";
+import { ExternalLink } from "components/ExternalLink";
import Header from "./Header";
const FileViewer = lazy(() => import("components/FileViewer"));
const Container = styled.div`
- width: 100%;
display: flex;
flex-direction: column;
+ width: 100%;
gap: 8px;
`;
const LoaderContainer = styled.div`
- width: 100%;
display: flex;
justify-content: center;
+ width: 100%;
`;
-const NewTabInfo = styled.a`
- align-self: flex-end;
+const StyledExternalLink = styled(ExternalLink)`
display: flex;
- gap: 8px;
align-items: center;
-
- :hover {
- text-decoration: underline;
- svg path {
- transition: fill 0.1s;
- fill: ${({ theme }) => theme.secondaryBlue};
- }
- }
+ align-self: flex-end;
+ gap: 8px;
`;
const StyledNewTabIcon = styled(NewTabIcon)`
@@ -55,9 +48,9 @@ const AttachmentDisplay: React.FC = () => {
{url ? (
<>
-
+
Open in new tab
-
+
diff --git a/web/src/pages/Dashboard/JurorInfo/Header.tsx b/web/src/pages/Dashboard/JurorInfo/Header.tsx
index 1ff9492f8..00660f3b7 100644
--- a/web/src/pages/Dashboard/JurorInfo/Header.tsx
+++ b/web/src/pages/Dashboard/JurorInfo/Header.tsx
@@ -10,6 +10,7 @@ import { responsiveSize } from "styles/responsiveSize";
import HowItWorks from "components/HowItWorks";
import JurorLevels from "components/Popup/MiniGuides/JurorLevels";
+import { ExternalLink } from "components/ExternalLink";
const Container = styled.div`
display: flex;
@@ -51,18 +52,9 @@ const StyledXIcon = styled(XIcon)`
fill: ${({ theme }) => theme.primaryBlue};
`;
-const StyledLink = styled.a`
+const StyledLink = styled(ExternalLink)`
display: flex;
- border: 0px;
- align-items: center;
gap: 8px;
-
- &:hover {
- text-decoration: underline;
- svg {
- fill: ${({ theme }) => theme.secondaryBlue};
- }
- }
`;
interface IHeader {
@@ -90,7 +82,7 @@ const Header: React.FC = ({ levelTitle, levelNumber, totalCoherentVotes
MiniGuideComponent={JurorLevels}
/>
{totalResolvedVotes > 0 ? (
-
+
Share your juror score
) : null}
diff --git a/web/src/pages/Home/Community/Element.tsx b/web/src/pages/Home/Community/Element.tsx
index 283262267..84c90d63b 100644
--- a/web/src/pages/Home/Community/Element.tsx
+++ b/web/src/pages/Home/Community/Element.tsx
@@ -1,6 +1,8 @@
import React from "react";
import styled from "styled-components";
+import { ExternalLink } from "components/ExternalLink";
+
const Container = styled.div`
display: flex;
gap: 8px;
@@ -18,14 +20,10 @@ const StyledLabel = styled.label`
font-weight: 600;
`;
-const StyledA = styled.a`
+const StyledA = styled(ExternalLink)`
display: flex;
align-items: center;
gap: 8px;
-
- &:hover {
- text-decoration: underline;
- }
`;
export interface IElement {
@@ -38,7 +36,7 @@ export interface IElement {
export const Element: React.FC = ({ primaryText, title, link, Icon }) => (
-
+
{Icon && }
{title}
diff --git a/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
index 5ab94d883..a60ae994e 100644
--- a/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
+++ b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
@@ -1,9 +1,11 @@
import React, { useMemo } from "react";
import styled from "styled-components";
-import { IdenticonOrAvatar, AddressOrName } from "components/ConnectWallet/AccountDisplay";
import { DEFAULT_CHAIN, getChain } from "consts/chains";
+import { IdenticonOrAvatar, AddressOrName } from "components/ConnectWallet/AccountDisplay";
+import { ExternalLink } from "components/ExternalLink";
+
const Container = styled.div`
display: flex;
gap: 8px;
@@ -20,12 +22,11 @@ const Container = styled.div`
}
`;
-const StyledA = styled.a`
+const StyledExternalLink = styled(ExternalLink)`
:hover {
- text-decoration: underline;
label {
cursor: pointer;
- color: ${({ theme }) => theme.secondaryBlue};
+ color: ${({ theme }) => theme.primaryBlue};
}
}
`;
@@ -42,9 +43,9 @@ const JurorTitle: React.FC = ({ address }) => {
return (
-
+
-
+
);
};
diff --git a/web/src/styles/global-style.ts b/web/src/styles/global-style.ts
index 546ec90da..9b1f1d58f 100644
--- a/web/src/styles/global-style.ts
+++ b/web/src/styles/global-style.ts
@@ -17,6 +17,7 @@ export const GlobalStyle = createGlobalStyle`
body {
font-family: "Open Sans", sans-serif;
margin: 0px;
+ background-color: ${({ theme }) => theme.primaryPurple};
}
html {
@@ -93,10 +94,6 @@ export const GlobalStyle = createGlobalStyle`
transition: color 0.1s;
}
- a:hover {
- color: ${({ theme }) => theme.secondaryBlue} !important;
- }
-
hr {
opacity: 1;
border: 1px solid ${({ theme }) => theme.stroke};
diff --git a/web/src/styles/themes.ts b/web/src/styles/themes.ts
index 6715eccfb..e648ca4ba 100644
--- a/web/src/styles/themes.ts
+++ b/web/src/styles/themes.ts
@@ -25,7 +25,8 @@ export const lightTheme = {
defaultShadow: "#00000002",
hoveredShadow: "#00000002",
- whiteLowOpacity: "#0000000d",
+ whiteLowOpacitySubtle: "#FFFFFF0D",
+ whiteLowOpacityStrong: "#FFFFFF26",
blackLowOpacity: "#00000080",
success: "#00C42B",
@@ -72,7 +73,8 @@ export const darkTheme = {
defaultShadow: "#00000000",
hoveredShadow: "#42498f80",
- whiteLowOpacity: "#FFFFFF0F",
+ whiteLowOpacitySubtle: "#FFFFFF0F",
+ whiteLowOpacityStrong: "#FFFFFF24",
blackLowOpacity: "#00000080",
success: "#65DC7F",
From bc0298526263772081b829e682db717020e741bf Mon Sep 17 00:00:00 2001
From: kemuru <102478601+kemuru@users.noreply.github.com>
Date: Tue, 3 Dec 2024 17:34:10 +0100
Subject: [PATCH 04/11] fix: responsiveness in macbook air m1 13dot3 inches,
cases grid, extrastats
---
web/src/components/CasesDisplay/CasesGrid.tsx | 4 ++--
web/src/components/LatestCases.tsx | 4 ++--
web/src/pages/Home/CourtOverview/ExtraStats.tsx | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/web/src/components/CasesDisplay/CasesGrid.tsx b/web/src/components/CasesDisplay/CasesGrid.tsx
index a61051dd5..2aa57c20c 100644
--- a/web/src/components/CasesDisplay/CasesGrid.tsx
+++ b/web/src/components/CasesDisplay/CasesGrid.tsx
@@ -17,9 +17,9 @@ import DisputeView from "components/DisputeView";
import { SkeletonDisputeCard, SkeletonDisputeListItem } from "../StyledSkeleton";
const GridContainer = styled.div`
- --gap: 24px;
+ --gap: 16px;
display: grid;
- grid-template-columns: repeat(auto-fill, minmax(min(100%, max(350px, (100% - var(--gap) * 2)/3)), 1fr));
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, max(312px, (100% - var(--gap) * 2)/3)), 1fr));
align-items: center;
gap: var(--gap);
`;
diff --git a/web/src/components/LatestCases.tsx b/web/src/components/LatestCases.tsx
index a85396f39..c0d57ba98 100644
--- a/web/src/components/LatestCases.tsx
+++ b/web/src/components/LatestCases.tsx
@@ -21,9 +21,9 @@ const Title = styled.h1`
`;
const DisputeContainer = styled.div`
- --gap: 24px;
+ --gap: 16px;
display: grid;
- grid-template-columns: repeat(auto-fill, minmax(min(100%, max(350px, (100% - var(--gap) * 2)/3)), 1fr));
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, max(312px, (100% - var(--gap) * 2)/3)), 1fr));
align-items: center;
gap: var(--gap);
`;
diff --git a/web/src/pages/Home/CourtOverview/ExtraStats.tsx b/web/src/pages/Home/CourtOverview/ExtraStats.tsx
index f0fbdd4fb..c75517ed7 100644
--- a/web/src/pages/Home/CourtOverview/ExtraStats.tsx
+++ b/web/src/pages/Home/CourtOverview/ExtraStats.tsx
@@ -13,7 +13,7 @@ import ExtraStatsDisplay from "components/ExtraStatsDisplay";
const StyledCard = styled.div`
display: flex;
flex-wrap: wrap;
- gap: 0 32px;
+ gap: 0 24px;
justify-content: center;
`;
From 738314b92ebc6aca3a4a7f778883d2fa27403b21 Mon Sep 17 00:00:00 2001
From: kemuru <102478601+kemuru@users.noreply.github.com>
Date: Wed, 4 Dec 2024 00:30:12 +0100
Subject: [PATCH 05/11] feat: tons of improvements
---
.../src/assets/svgs/socialmedia/discord.svg | 4 +-
.../src/assets/svgs/socialmedia/etherscan.svg | 4 +-
.../assets/svgs/socialmedia/ghost-blog.svg | 4 +-
.../src/assets/svgs/socialmedia/github.svg | 4 +-
.../src/assets/svgs/socialmedia/linkedin.svg | 4 +-
.../src/assets/svgs/socialmedia/reddit.svg | 4 +-
.../src/assets/svgs/socialmedia/slack.svg | 4 +-
.../src/assets/svgs/socialmedia/snapshot.svg | 4 +-
.../src/assets/svgs/socialmedia/youtube.svg | 4 +-
.../assets/svgs/footer/secured-by-kleros.svg | 8 +--
web/src/assets/svgs/icons/book-open.svg | 2 +-
web/src/assets/svgs/icons/close.svg | 2 +-
web/src/assets/svgs/icons/code.svg | 18 ++-----
web/src/assets/svgs/icons/eth.svg | 2 +-
web/src/assets/svgs/socialmedia/discord.svg | 4 +-
web/src/assets/svgs/socialmedia/etherscan.svg | 4 +-
.../assets/svgs/socialmedia/ghost-blog.svg | 4 +-
web/src/assets/svgs/socialmedia/github.svg | 4 +-
web/src/assets/svgs/socialmedia/linkedin.svg | 4 +-
web/src/assets/svgs/socialmedia/reddit.svg | 4 +-
web/src/assets/svgs/socialmedia/slack.svg | 4 +-
web/src/assets/svgs/socialmedia/snapshot.svg | 4 +-
web/src/assets/svgs/socialmedia/telegram.svg | 4 +-
web/src/assets/svgs/socialmedia/youtube.svg | 4 +-
web/src/components/DottedMenuButton.tsx | 5 ++
web/src/components/HowItWorks.tsx | 2 +-
web/src/components/LightButton.tsx | 3 +-
.../MiniGuides/MainStructureTemplate.tsx | 4 ++
web/src/consts/socialmedia.tsx | 14 +++--
web/src/layout/Footer/index.tsx | 53 ++++++++++---------
web/src/layout/Header/MobileHeader.tsx | 6 +--
web/src/layout/Header/navbar/Menu/Help.tsx | 29 +++++-----
.../StakePanel/SimulatorPopup/index.tsx | 2 +-
.../Courts/CourtDetails/StakePanel/index.tsx | 2 +-
web/src/pages/Courts/CourtDetails/Stats.tsx | 26 +++++----
web/src/pages/Courts/CourtDetails/index.tsx | 19 ++++---
web/src/pages/Resolver/Parameters/Jurors.tsx | 5 ++
37 files changed, 148 insertions(+), 130 deletions(-)
diff --git a/web-devtools/src/assets/svgs/socialmedia/discord.svg b/web-devtools/src/assets/svgs/socialmedia/discord.svg
index cd9ecfead..8689eefd8 100644
--- a/web-devtools/src/assets/svgs/socialmedia/discord.svg
+++ b/web-devtools/src/assets/svgs/socialmedia/discord.svg
@@ -1,10 +1,10 @@
-