From 8e45aa7af89b3fe61bed99ffd73021c27bba1494 Mon Sep 17 00:00:00 2001
From: marino <102478601+kemuru@users.noreply.github.com>
Date: Wed, 25 Oct 2023 20:10:29 +0200
Subject: [PATCH 1/3] refactor(web): top jurors components modularization
---
.../pages/Home/TopJurors/Header/Coherency.tsx | 20 ++
.../Home/TopJurors/Header/HowItWorks.tsx | 27 +++
.../Home/TopJurors/Header/JurorTitle.tsx | 31 +++
web/src/pages/Home/TopJurors/Header/Rank.tsx | 34 ++++
.../pages/Home/TopJurors/Header/Rewards.tsx | 28 +++
web/src/pages/Home/TopJurors/Header/index.tsx | 60 ++++++
web/src/pages/Home/TopJurors/JurorCard.tsx | 188 ------------------
.../Home/TopJurors/JurorCard/Coherency.tsx | 27 +++
.../Home/TopJurors/JurorCard/HowItWorks.tsx | 27 +++
.../Home/TopJurors/JurorCard/JurorTitle.tsx | 46 +++++
.../pages/Home/TopJurors/JurorCard/Rank.tsx | 34 ++++
.../Home/TopJurors/JurorCard/Rewards.tsx | 55 +++++
.../pages/Home/TopJurors/JurorCard/index.tsx | 74 +++++++
.../pages/Home/TopJurors/TopJurorsHeader.tsx | 156 ---------------
web/src/pages/Home/TopJurors/index.tsx | 4 +-
15 files changed, 465 insertions(+), 346 deletions(-)
create mode 100644 web/src/pages/Home/TopJurors/Header/Coherency.tsx
create mode 100644 web/src/pages/Home/TopJurors/Header/HowItWorks.tsx
create mode 100644 web/src/pages/Home/TopJurors/Header/JurorTitle.tsx
create mode 100644 web/src/pages/Home/TopJurors/Header/Rank.tsx
create mode 100644 web/src/pages/Home/TopJurors/Header/Rewards.tsx
create mode 100644 web/src/pages/Home/TopJurors/Header/index.tsx
delete mode 100644 web/src/pages/Home/TopJurors/JurorCard.tsx
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/HowItWorks.tsx
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/Rank.tsx
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/index.tsx
delete mode 100644 web/src/pages/Home/TopJurors/TopJurorsHeader.tsx
diff --git a/web/src/pages/Home/TopJurors/Header/Coherency.tsx b/web/src/pages/Home/TopJurors/Header/Coherency.tsx
new file mode 100644
index 000000000..d190805fb
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/Header/Coherency.tsx
@@ -0,0 +1,20 @@
+import React from "react";
+import styled from "styled-components";
+import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip";
+
+const Container = styled.div``;
+
+const coherentVotesTooltipMsg =
+ "This is the ratio of coherent votes made by a juror: " +
+ "the number in the left is the number of times where the juror " +
+ "voted coherently and the number in the right is the total number of times " +
+ "the juror voted";
+
+const Coherency: React.FC = () => (
+
+
+
+
+
+);
+export default Coherency;
diff --git a/web/src/pages/Home/TopJurors/Header/HowItWorks.tsx b/web/src/pages/Home/TopJurors/Header/HowItWorks.tsx
new file mode 100644
index 000000000..95c8923c0
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/Header/HowItWorks.tsx
@@ -0,0 +1,27 @@
+import React from "react";
+import styled from "styled-components";
+import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg";
+
+const Container = styled.div`
+ display: flex;
+ align-items: center;
+ gap: 8px;
+
+ label {
+ color: ${({ theme }) => theme.primaryBlue};
+ }
+
+ svg {
+ path {
+ fill: ${({ theme }) => theme.primaryBlue};
+ }
+ }
+`;
+
+const Rewards: React.FC = () => (
+
+
+
+
+);
+export default Rewards;
diff --git a/web/src/pages/Home/TopJurors/Header/JurorTitle.tsx b/web/src/pages/Home/TopJurors/Header/JurorTitle.tsx
new file mode 100644
index 000000000..ff402fa2f
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/Header/JurorTitle.tsx
@@ -0,0 +1,31 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+
+const Container = styled.div`
+ display: flex;
+ gap: 16px;
+ align-items: center;
+
+ label {
+ font-weight: 400;
+ font-size: 14px;
+ line-height: 19px;
+ color: ${({ theme }) => theme.secondaryText} !important;
+ }
+
+ ${landscapeStyle(
+ () =>
+ css`
+ width: calc(40px + (220 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
+ gap: 36px;
+ `
+ )}
+`;
+
+const JurorTitle: React.FC = () => (
+
+
+
+);
+export default JurorTitle;
diff --git a/web/src/pages/Home/TopJurors/Header/Rank.tsx b/web/src/pages/Home/TopJurors/Header/Rank.tsx
new file mode 100644
index 000000000..40753e0f8
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/Header/Rank.tsx
@@ -0,0 +1,34 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+
+const Container = styled.div`
+ width: 50%;
+
+ label {
+ &::before {
+ content: "Ranking";
+ visibility: visible;
+ }
+ }
+
+ ${landscapeStyle(
+ () =>
+ css`
+ width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
+
+ label {
+ &::before {
+ content: "#";
+ }
+ }
+ `
+ )}
+`;
+
+const Rank: React.FC = () => (
+
+
+
+);
+export default Rank;
diff --git a/web/src/pages/Home/TopJurors/Header/Rewards.tsx b/web/src/pages/Home/TopJurors/Header/Rewards.tsx
new file mode 100644
index 000000000..877b457dd
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/Header/Rewards.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip";
+
+const Container = styled.div`
+ ${landscapeStyle(
+ () =>
+ css`
+ width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
+ `
+ )}
+`;
+
+const totalRewardsTooltipMsg =
+ "Users have an economic interest in serving as jurors in Kleros: " +
+ "collecting the Juror Rewards in exchange for their work. Each juror who " +
+ "is coherent with the final ruling receive the Juror Rewards composed of " +
+ "arbitration fees (ETH) + PNK redistribution between jurors.";
+
+const Rewards: React.FC = () => (
+
+
+
+
+
+);
+export default Rewards;
diff --git a/web/src/pages/Home/TopJurors/Header/index.tsx b/web/src/pages/Home/TopJurors/Header/index.tsx
new file mode 100644
index 000000000..be2f23eaa
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/Header/index.tsx
@@ -0,0 +1,60 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+import Rank from "./Rank";
+import JurorTitle from "./JurorTitle";
+import Rewards from "./Rewards";
+import Coherency from "./Coherency";
+import HowItWorks from "./HowItWorks";
+
+const Container = styled.div`
+ display: flex;
+ justify-content: space-between;
+ width: 100%;
+ height: 100%;
+ background-color: ${({ theme }) => theme.lightBlue};
+ padding: 24px;
+ border 1px solid ${({ theme }) => theme.stroke};
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+ flex-wrap: wrap;
+
+ ${landscapeStyle(
+ () =>
+ css`
+ flex-wrap: nowrap;
+ gap: 0px;
+ padding: 18.6px 32px;
+ `
+ )}
+`;
+
+const PlaceAndTitleAndRewardsAndCoherency = styled.div`
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+
+ ${landscapeStyle(
+ () =>
+ css`
+ flex-direction: row;
+ gap: 32px;
+ `
+ )}
+`;
+
+const Header: React.FC = () => {
+ return (
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default Header;
diff --git a/web/src/pages/Home/TopJurors/JurorCard.tsx b/web/src/pages/Home/TopJurors/JurorCard.tsx
deleted file mode 100644
index 558212f5e..000000000
--- a/web/src/pages/Home/TopJurors/JurorCard.tsx
+++ /dev/null
@@ -1,188 +0,0 @@
-import React from "react";
-import styled, { css } from "styled-components";
-import { landscapeStyle } from "styles/landscapeStyle";
-import { IdenticonOrAvatar, AddressOrName } from "components/ConnectWallet/AccountDisplay";
-import EthIcon from "assets/svgs/icons/eth.svg";
-import PnkIcon from "assets/svgs/icons/kleros.svg";
-import PixelArt from "pages/Dashboard/JurorInfo/PixelArt";
-import { getFormattedRewards } from "utils/jurorRewardConfig";
-import { getUserLevelData } from "utils/userLevelCalculation";
-import { useUserQuery } from "hooks/queries/useUser";
-
-const Container = styled.div`
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- width: 100%;
- height: 100%;
- background-color: ${({ theme }) => theme.whiteBackground};
- padding: 24px;
- border 1px solid ${({ theme }) => theme.stroke};
- border-top: none;
- align-items: center;
-
- label {
- font-size: 16px;
- }
-
- ${landscapeStyle(
- () => css`
- gap: 0px;
- padding: 15.55px 32px;
- flex-wrap: nowrap;
- `
- )}
-`;
-
-const LogoAndAddress = styled.div`
- display: flex;
- gap: 10px;
- align-items: center;
-
- canvas {
- width: 20px;
- height: 20px;
- border-radius: 10%;
- }
-`;
-
-const PlaceAndTitleAndRewardsAndCoherency = styled.div`
- display: flex;
- flex-direction: column;
- gap: 12px;
-
- ${landscapeStyle(
- () =>
- css`
- flex-direction: row;
- gap: 32px;
- `
- )}
-`;
-
-const JurorPlace = styled.div`
- width: 100%;
-
- label::before {
- content: "#";
- display: inline;
- }
-
- ${landscapeStyle(
- () => css`
- width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
- label::before {
- display: none;
- }
- `
- )}
-`;
-
-const JurorTitle = styled.div`
- display: flex;
- gap: 16px;
- align-items: center;
- justify-content: flex-start;
-
- ${landscapeStyle(
- () => css`
- width: calc(40px + (220 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
- gap: 36px;
- `
- )}
-`;
-
-const Rewards = styled.div`
- display: flex;
- gap: 8px;
- align-items: center;
- label {
- font-weight: 600;
- }
- width: 164px;
- flex-wrap: wrap;
-
- ${landscapeStyle(
- () =>
- css`
- width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
- `
- )}
-`;
-
-const Coherency = styled.div`
- display: flex;
- align-items: center;
- label {
- font-weight: 600;
- }
- flex-wrap: wrap;
-`;
-
-const StyledIcon = styled.div`
- width: 16px;
- height: 16px;
-
- path {
- fill: ${({ theme }) => theme.secondaryPurple};
- }
-`;
-
-const HowItWorks = styled.div`
- display: flex;
- align-items: center;
- gap: 16px;
-`;
-
-const StyledIdenticonOrAvatar = styled(IdenticonOrAvatar)``;
-
-interface IJurorCard {
- rank: number;
- address: `0x${string}`;
- coherenceScore: number;
- totalCoherent: number;
- totalResolvedDisputes: number;
-}
-
-const JurorCard: React.FC = ({ rank, address, coherenceScore, totalCoherent, totalResolvedDisputes }) => {
- const { data } = useUserQuery(address?.toLowerCase());
-
- const coherenceRatio = `${totalCoherent}/${totalResolvedDisputes}`;
- const userLevelData = getUserLevelData(coherenceScore);
-
- const formattedRewards = getFormattedRewards(data, {});
- const ethReward = formattedRewards.find((r) => r.token === "ETH")?.amount;
- const pnkReward = formattedRewards.find((r) => r.token === "PNK")?.amount;
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-export default JurorCard;
diff --git a/web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx b/web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx
new file mode 100644
index 000000000..05adf7416
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx
@@ -0,0 +1,27 @@
+import React from "react";
+import styled from "styled-components";
+
+const Container = styled.div`
+ display: flex;
+ align-items: center;
+ label {
+ font-weight: 600;
+ }
+ flex-wrap: wrap;
+`;
+
+interface ICoherency {
+ totalCoherent: number;
+ totalResolvedDisputes: number;
+}
+
+const Coherency: React.FC = ({ totalCoherent, totalResolvedDisputes }) => {
+ const coherenceRatio = `${totalCoherent}/${totalResolvedDisputes}`;
+
+ return (
+
+
+
+ );
+};
+export default Coherency;
diff --git a/web/src/pages/Home/TopJurors/JurorCard/HowItWorks.tsx b/web/src/pages/Home/TopJurors/JurorCard/HowItWorks.tsx
new file mode 100644
index 000000000..3520e1649
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/JurorCard/HowItWorks.tsx
@@ -0,0 +1,27 @@
+import React from "react";
+import styled from "styled-components";
+import PixelArt from "pages/Dashboard/JurorInfo/PixelArt";
+import { getUserLevelData } from "utils/userLevelCalculation";
+
+const Container = styled.div`
+ display: flex;
+ align-items: center;
+ gap: 16px;
+`;
+
+interface IHowItWorks {
+ coherenceScore: number;
+}
+
+const HowItWorks: React.FC = ({ coherenceScore }) => {
+ const userLevelData = getUserLevelData(coherenceScore);
+ const level = userLevelData.level;
+
+ return (
+
+
+
+
+ );
+};
+export default HowItWorks;
diff --git a/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
new file mode 100644
index 000000000..733be29b9
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/JurorCard/JurorTitle.tsx
@@ -0,0 +1,46 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+import { IdenticonOrAvatar, AddressOrName } from "components/ConnectWallet/AccountDisplay";
+
+const Container = styled.div`
+ display: flex;
+ gap: 16px;
+ align-items: center;
+ justify-content: flex-start;
+
+ ${landscapeStyle(
+ () => css`
+ width: calc(40px + (220 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
+ gap: 36px;
+ `
+ )}
+`;
+
+const LogoAndAddress = styled.div`
+ display: flex;
+ gap: 10px;
+ align-items: center;
+
+ canvas {
+ width: 20px;
+ height: 20px;
+ border-radius: 10%;
+ }
+`;
+
+interface IJurorTitle {
+ address: string;
+}
+
+const JurorTitle: React.FC = ({ address }) => {
+ return (
+
+
+
+
+
+
+ );
+};
+export default JurorTitle;
diff --git a/web/src/pages/Home/TopJurors/JurorCard/Rank.tsx b/web/src/pages/Home/TopJurors/JurorCard/Rank.tsx
new file mode 100644
index 000000000..ce7c64899
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/JurorCard/Rank.tsx
@@ -0,0 +1,34 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+
+const Container = styled.div`
+ width: 100%;
+
+ label::before {
+ content: "#";
+ display: inline;
+ }
+
+ ${landscapeStyle(
+ () => css`
+ width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
+ label::before {
+ display: none;
+ }
+ `
+ )}
+`;
+
+interface IRank {
+ rank: number;
+}
+
+const Rank: React.FC = ({ rank }) => {
+ return (
+
+
+
+ );
+};
+export default Rank;
diff --git a/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx b/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx
new file mode 100644
index 000000000..a2dc84225
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/JurorCard/Rewards.tsx
@@ -0,0 +1,55 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+import { getFormattedRewards } from "utils/jurorRewardConfig";
+import EthIcon from "assets/svgs/icons/eth.svg";
+import PnkIcon from "assets/svgs/icons/kleros.svg";
+
+const Container = styled.div`
+ display: flex;
+ gap: 8px;
+ align-items: center;
+ label {
+ font-weight: 600;
+ }
+ width: 164px;
+ flex-wrap: wrap;
+
+ ${landscapeStyle(
+ () =>
+ css`
+ width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
+ `
+ )}
+`;
+
+const StyledIcon = styled.div`
+ width: 16px;
+ height: 16px;
+
+ path {
+ fill: ${({ theme }) => theme.secondaryPurple};
+ }
+`;
+
+interface IRewards {
+ data: any;
+}
+
+const Rewards: React.FC = ({ data }) => {
+ const formattedRewards = getFormattedRewards(data, {});
+ console.log(data);
+ const ethReward = formattedRewards.find((r) => r.token === "ETH")?.amount;
+ const pnkReward = formattedRewards.find((r) => r.token === "PNK")?.amount;
+
+ return (
+
+
+
+
+
+
+
+ );
+};
+export default Rewards;
diff --git a/web/src/pages/Home/TopJurors/JurorCard/index.tsx b/web/src/pages/Home/TopJurors/JurorCard/index.tsx
new file mode 100644
index 000000000..c90f4627a
--- /dev/null
+++ b/web/src/pages/Home/TopJurors/JurorCard/index.tsx
@@ -0,0 +1,74 @@
+import React from "react";
+import styled, { css } from "styled-components";
+import { landscapeStyle } from "styles/landscapeStyle";
+import Rank from "./Rank";
+import JurorTitle from "./JurorTitle";
+import { useUserQuery } from "hooks/queries/useUser";
+import Rewards from "./Rewards";
+import Coherency from "./Coherency";
+import HowItWorks from "./HowItWorks";
+
+const Container = styled.div`
+ display: flex;
+ justify-content: space-between;
+ flex-wrap: wrap;
+ width: 100%;
+ height: 100%;
+ background-color: ${({ theme }) => theme.whiteBackground};
+ padding: 24px;
+ border 1px solid ${({ theme }) => theme.stroke};
+ border-top: none;
+ align-items: center;
+
+ label {
+ font-size: 16px;
+ }
+
+ ${landscapeStyle(
+ () => css`
+ gap: 0px;
+ padding: 15.55px 32px;
+ flex-wrap: nowrap;
+ `
+ )}
+`;
+
+const PlaceAndTitleAndRewardsAndCoherency = styled.div`
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+
+ ${landscapeStyle(
+ () =>
+ css`
+ flex-direction: row;
+ gap: 32px;
+ `
+ )}
+`;
+
+interface IJurorCard {
+ rank: number;
+ address: `0x${string}`;
+ coherenceScore: number;
+ totalCoherent: number;
+ totalResolvedDisputes: number;
+}
+
+const JurorCard: React.FC = ({ rank, address, coherenceScore, totalCoherent, totalResolvedDisputes }) => {
+ const { data } = useUserQuery(address?.toLowerCase());
+
+ return (
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default JurorCard;
diff --git a/web/src/pages/Home/TopJurors/TopJurorsHeader.tsx b/web/src/pages/Home/TopJurors/TopJurorsHeader.tsx
deleted file mode 100644
index 1130b8580..000000000
--- a/web/src/pages/Home/TopJurors/TopJurorsHeader.tsx
+++ /dev/null
@@ -1,156 +0,0 @@
-import React from "react";
-import styled, { css } from "styled-components";
-import { landscapeStyle } from "styles/landscapeStyle";
-import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip";
-import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg";
-
-const Container = styled.div`
- display: flex;
- justify-content: space-between;
- width: 100%;
- height: 100%;
- background-color: ${({ theme }) => theme.lightBlue};
- padding: 24px;
- border 1px solid ${({ theme }) => theme.stroke};
- border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- flex-wrap: wrap;
-
- ${landscapeStyle(
- () =>
- css`
- flex-wrap: nowrap;
- gap: 0px;
- padding: 18.6px 32px;
- `
- )}
-`;
-
-const PlaceAndTitleAndRewardsAndCoherency = styled.div`
- display: flex;
- flex-direction: column;
- gap: 8px;
-
- ${landscapeStyle(
- () =>
- css`
- flex-direction: row;
- gap: 32px;
- `
- )}
-`;
-
-const JurorPlace = styled.div`
- width: 100%;
-
- label {
- &::before {
- content: "# Rank";
- visibility: visible;
- }
- }
-
- ${landscapeStyle(
- () =>
- css`
- width: calc(16px + (24 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
-
- label {
- &::before {
- content: "#";
- }
- }
- `
- )}
-`;
-
-const JurorTitle = styled.div`
- display: flex;
- gap: 16px;
- align-items: center;
-
- label {
- font-weight: 400;
- font-size: 14px;
- line-height: 19px;
- color: ${({ theme }) => theme.secondaryText} !important;
- }
-
- ${landscapeStyle(
- () =>
- css`
- width: calc(40px + (220 - 40) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
- gap: 36px;
- `
- )}
-`;
-
-const Rewards = styled.div`
- ${landscapeStyle(
- () =>
- css`
- width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
- `
- )}
-`;
-
-const Coherency = styled.div``;
-
-const HowItWorks = styled.div`
- display: flex;
- align-items: center;
- gap: 8px;
-
- label {
- color: ${({ theme }) => theme.primaryBlue};
- }
-
- svg {
- path {
- fill: ${({ theme }) => theme.primaryBlue};
- }
- }
-`;
-
-const totalRewardsTooltipMsg =
- "Users have an economic interest in serving as jurors in Kleros: " +
- "collecting the Juror Rewards in exchange for their work. Each juror who " +
- "is coherent with the final ruling receive the Juror Rewards composed of " +
- "arbitration fees (ETH) + PNK redistribution between jurors.";
-
-const coherentVotesTooltipMsg =
- "This is the ratio of coherent votes made by a juror: " +
- "the number in the left is the number of times where the juror " +
- "voted coherently and the number in the right is the total number of times " +
- "the juror voted";
-
-const TopJurorsHeader: React.FC = () => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-export default TopJurorsHeader;
diff --git a/web/src/pages/Home/TopJurors/index.tsx b/web/src/pages/Home/TopJurors/index.tsx
index 043912bbd..e7e623ace 100644
--- a/web/src/pages/Home/TopJurors/index.tsx
+++ b/web/src/pages/Home/TopJurors/index.tsx
@@ -2,7 +2,7 @@ import React from "react";
import styled from "styled-components";
import { SkeletonDisputeListItem } from "components/StyledSkeleton";
import { isUndefined } from "utils/index";
-import TopJurorsHeader from "./TopJurorsHeader";
+import Header from "./Header";
import JurorCard from "./JurorCard";
import { useTopUsersByCoherenceScore } from "queries/useTopUsersByCoherenceScore";
@@ -32,7 +32,7 @@ const TopJurors: React.FC = () => {
Top Jurors
-
+
{!isUndefined(topJurors)
? topJurors.map((juror) => )
: [...Array(5)].map((_, i) => )}
From 38f61bce7266bdc84df1bb8a27374b4fec7d4ac7 Mon Sep 17 00:00:00 2001
From: marino <102478601+kemuru@users.noreply.github.com>
Date: Thu, 26 Oct 2023 01:27:33 +0200
Subject: [PATCH 2/3] feat(web): mobile version top jurors + bunch of code
refactors
---
web/src/assets/svgs/menu-icons/help.svg | 4 +-
web/src/pages/Dashboard/WithHelpTooltip.tsx | 14 ++-
.../pages/Home/TopJurors/Header/Coherency.tsx | 44 ++++++--
.../Home/TopJurors/Header/JurorTitle.tsx | 14 +--
web/src/pages/Home/TopJurors/Header/Rank.tsx | 21 +---
.../pages/Home/TopJurors/Header/Rewards.tsx | 17 ++-
web/src/pages/Home/TopJurors/Header/index.tsx | 22 ++--
.../Home/TopJurors/JurorCard/Coherency.tsx | 1 +
.../Home/TopJurors/JurorCard/DesktopCard.tsx | 66 +++++++++++
.../Home/TopJurors/JurorCard/HowItWorks.tsx | 28 ++++-
.../Home/TopJurors/JurorCard/JurorTitle.tsx | 28 ++---
.../Home/TopJurors/JurorCard/MobileCard.tsx | 104 ++++++++++++++++++
.../pages/Home/TopJurors/JurorCard/Rank.tsx | 5 +-
.../Home/TopJurors/JurorCard/Rewards.tsx | 11 +-
.../pages/Home/TopJurors/JurorCard/index.tsx | 64 ++---------
web/src/pages/Home/TopJurors/index.tsx | 2 +-
16 files changed, 308 insertions(+), 137 deletions(-)
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx
create mode 100644 web/src/pages/Home/TopJurors/JurorCard/MobileCard.tsx
diff --git a/web/src/assets/svgs/menu-icons/help.svg b/web/src/assets/svgs/menu-icons/help.svg
index 71c5d151e..1c89e1fcf 100644
--- a/web/src/assets/svgs/menu-icons/help.svg
+++ b/web/src/assets/svgs/menu-icons/help.svg
@@ -1,3 +1,3 @@
-