Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/src/components/CasesDisplay/CasesListHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip";
import WithHelpTooltip from "components/WithHelpTooltip";

const Container = styled.div`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Dashboard/JurorInfo/Coherency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import { CircularProgress } from "@kleros/ui-components-library";
import WithHelpTooltip from "../WithHelpTooltip";
import WithHelpTooltip from "components/WithHelpTooltip";

const Container = styled.div`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Dashboard/JurorInfo/JurorRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import styled from "styled-components";
import { useAccount } from "wagmi";
import TokenRewards from "./TokenRewards";
import WithHelpTooltip from "../WithHelpTooltip";
import WithHelpTooltip from "components/WithHelpTooltip";
import { getFormattedRewards } from "utils/jurorRewardConfig";
import { CoinIds } from "consts/coingecko";
import { useUserQuery } from "queries/useUser";
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Dashboard/JurorInfo/StakingRewards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import styled from "styled-components";
import { Box as _Box, Button } from "@kleros/ui-components-library";
import TokenRewards from "./TokenRewards";
import WithHelpTooltip from "../WithHelpTooltip";
import WithHelpTooltip from "components/WithHelpTooltip";
import { EnsureChain } from "components/EnsureChain";

const Container = styled.div`
Expand Down
3 changes: 2 additions & 1 deletion web/src/pages/Home/TopJurors/Header/Coherency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import styled, { css } from "styled-components";
import { BREAKPOINT_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
import { useWindowSize } from "react-use";
import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip";
import WithHelpTooltip from "components/WithHelpTooltip";

const Container = styled.div`
display: flex;
Expand All @@ -17,6 +17,7 @@ const Container = styled.div`
() =>
css`
font-size: 14px !important;
justify-content: center;
&::before {
content: "Coherent Votes";
}
Expand Down
60 changes: 60 additions & 0 deletions web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React from "react";
import { useToggle } from "react-use";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import Rewards from "./Rewards";
import Coherency from "./Coherency";
import HowItWorks from "components/HowItWorks";
import JurorLevels from "components/Popup/MiniGuides/JurorLevels";

const Container = styled.div`
display: none;
width: 100%;
background-color: ${({ theme }) => theme.lightBlue};
border 1px solid ${({ theme }) => theme.stroke};
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom: 1px solid ${({ theme }) => theme.stroke};
padding: 18.6px 32px;

${landscapeStyle(
() =>
css`
display: grid;
grid-template-columns:
min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350))
auto;
column-gap: calc(12px + (28 - 12) * (min(max(100vw, 900px), 1250px) - 900px) / 350);
align-items: center;
`
)}
`;

const StyledLabel = styled.label`
font-size: 16px;
`;

const HowItWorksContainer = styled.div`
display: flex;
justify-content: end;
`;

export const DesktopHeader: React.FC = () => {
const [isJurorLevelsMiniGuideOpen, toggleJurorLevelsMiniGuide] = useToggle(false);

return (
<Container>
<StyledLabel>#</StyledLabel>
<StyledLabel>Juror</StyledLabel>
<Rewards />
<Coherency />
<HowItWorksContainer>
<HowItWorks
isMiniGuideOpen={isJurorLevelsMiniGuideOpen}
toggleMiniGuide={toggleJurorLevelsMiniGuide}
MiniGuideComponent={JurorLevels}
/>
</HowItWorksContainer>
</Container>
);
};
9 changes: 0 additions & 9 deletions web/src/pages/Home/TopJurors/Header/JurorTitle.tsx

This file was deleted.

42 changes: 42 additions & 0 deletions web/src/pages/Home/TopJurors/Header/MobileHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from "react";
import { useToggle } from "react-use";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import HowItWorks from "components/HowItWorks";
import JurorLevels from "components/Popup/MiniGuides/JurorLevels";

const Container = styled.div`
display: flex;
justify-content: space-between;
width: 100%;
background-color: ${({ theme }) => theme.lightBlue};
padding: 24px;
border 1px solid ${({ theme }) => theme.stroke};
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom: none;
flex-wrap: wrap;
${landscapeStyle(
() => css`
display: none;
`
)}
`;

const StyledLabel = styled.label`
font-size: 16px;
`;

export const MobileHeader: React.FC = () => {
const [isJurorLevelsMiniGuideOpen, toggleJurorLevelsMiniGuide] = useToggle(false);
return (
<Container>
<StyledLabel>Ranking</StyledLabel>
<HowItWorks
isMiniGuideOpen={isJurorLevelsMiniGuideOpen}
toggleMiniGuide={toggleJurorLevelsMiniGuide}
MiniGuideComponent={JurorLevels}
/>
</Container>
);
};
10 changes: 0 additions & 10 deletions web/src/pages/Home/TopJurors/Header/Rank.tsx

This file was deleted.

5 changes: 2 additions & 3 deletions web/src/pages/Home/TopJurors/Header/Rewards.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip";
import WithHelpTooltip from "components/WithHelpTooltip";

const Container = styled.div`
display: flex;
Expand All @@ -16,9 +16,8 @@ const Container = styled.div`
${landscapeStyle(
() =>
css`
width: calc(60px + (240 - 60) * (min(max(100vw, 375px), 1250px) - 375px) / 875);

font-size: 14px !important;
justify-content: center;
&::before {
content: "Total Rewards";
}
Expand Down
75 changes: 6 additions & 69 deletions web/src/pages/Home/TopJurors/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,76 +1,13 @@
import React from "react";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import { useToggle } from "react-use";
import Rank from "./Rank";
import JurorTitle from "./JurorTitle";
import Rewards from "./Rewards";
import Coherency from "./Coherency";
import HowItWorks from "components/HowItWorks";
import JurorLevels from "components/Popup/MiniGuides/JurorLevels";

const Container = styled.div`
display: flex;
justify-content: space-between;
width: 100%;
background-color: ${({ theme }) => theme.lightBlue};
padding: 24px;
border 1px solid ${({ theme }) => theme.stroke};
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom: none;
flex-wrap: wrap;

${landscapeStyle(
() =>
css`
border-bottom: 1px solid ${({ theme }) => theme.stroke};
padding: 18.6px 32px;
`
)}
`;

const PlaceAndTitleAndRewardsAndCoherency = styled.div`
display: none;

${landscapeStyle(
() =>
css`
display: flex;
flex-direction: row;
gap: calc(20px + (28 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
align-items: center;
`
)}
`;

const StyledLabel = styled.label`
${landscapeStyle(
() =>
css`
display: none;
`
)}
`;
import { MobileHeader } from "./MobileHeader";
import { DesktopHeader } from "./DesktopHeader";

const Header: React.FC = () => {
const [isJurorLevelsMiniGuideOpen, toggleJurorLevelsMiniGuide] = useToggle(false);

return (
<Container>
<StyledLabel>Ranking</StyledLabel>
<PlaceAndTitleAndRewardsAndCoherency>
<Rank />
<JurorTitle />
<Rewards />
<Coherency />
</PlaceAndTitleAndRewardsAndCoherency>
<HowItWorks
isMiniGuideOpen={isJurorLevelsMiniGuideOpen}
toggleMiniGuide={toggleJurorLevelsMiniGuide}
MiniGuideComponent={JurorLevels}
/>
</Container>
<>
<MobileHeader />
<DesktopHeader />
</>
);
};

Expand Down
1 change: 1 addition & 0 deletions web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const Container = styled.div`
font-weight: 600;
color: ${({ theme }) => theme.primaryText};
flex-wrap: wrap;
justify-content: center;
`;

interface ICoherency {
Expand Down
33 changes: 11 additions & 22 deletions web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,28 @@ import Rank from "./Rank";
import JurorTitle from "./JurorTitle";
import Rewards from "./Rewards";
import Coherency from "./Coherency";
import HowItWorks from "./HowItWorks";
import JurorLevel from "./JurorLevel";

const Container = styled.div`
display: none;

justify-content: space-between;
flex-wrap: wrap;
width: 100%;
background-color: ${({ theme }) => theme.whiteBackground};
border: 1px solid ${({ theme }) => theme.stroke};
border-top: none;
align-items: center;
padding: 15.55px 32px;

label {
font-size: 16px;
}

${landscapeStyle(
() => css`
display: flex;
display: grid;
grid-template-columns:
min-content repeat(3, calc(160px + (180 - 160) * (min(max(100vw, 900px), 1250px) - 900px) / 350))
auto;
column-gap: calc(12px + (28 - 12) * (min(max(100vw, 900px), 1250px) - 900px) / 350);
`
)}
`;

const PlaceAndTitleAndRewardsAndCoherency = styled.div`
display: flex;
flex-direction: row;
gap: calc(20px + (28 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
`;

interface IDesktopCard {
rank: number;
address: string;
Expand All @@ -53,13 +44,11 @@ const DesktopCard: React.FC<IDesktopCard> = ({
}) => {
return (
<Container>
<PlaceAndTitleAndRewardsAndCoherency>
<Rank rank={rank} />
<JurorTitle address={address} />
<Rewards address={address} />
<Coherency totalCoherent={totalCoherent} totalResolvedDisputes={totalResolvedDisputes} />
</PlaceAndTitleAndRewardsAndCoherency>
<HowItWorks coherenceScore={coherenceScore} />
<Rank rank={rank} />
<JurorTitle address={address} />
<Rewards address={address} />
<Coherency totalCoherent={totalCoherent} totalResolvedDisputes={totalResolvedDisputes} />
<JurorLevel coherenceScore={coherenceScore} />
</Container>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const Container = styled.div`
${landscapeStyle(
() => css`
gap: 16px;
justify-content: end;
`
)}
`;
Expand All @@ -34,11 +35,11 @@ const StyledLabel = styled.label`
)}
`;

interface IHowItWorks {
interface IJurorLevel {
coherenceScore: number;
}

const HowItWorks: React.FC<IHowItWorks> = ({ coherenceScore }) => {
const JurorLevel: React.FC<IJurorLevel> = ({ coherenceScore }) => {
const userLevelData = getUserLevelData(coherenceScore);
const level = userLevelData.level;

Expand All @@ -49,4 +50,4 @@ const HowItWorks: React.FC<IHowItWorks> = ({ coherenceScore }) => {
</Container>
);
};
export default HowItWorks;
export default JurorLevel;
Loading