diff --git a/web/src/assets/svgs/mini-guides/appeal/crowdfund-appeal.svg b/web/src/assets/svgs/mini-guides/appeal/crowdfund-appeal.svg new file mode 100644 index 000000000..ff5a5f1ca --- /dev/null +++ b/web/src/assets/svgs/mini-guides/appeal/crowdfund-appeal.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/appeal/payoff-simulator.svg b/web/src/assets/svgs/mini-guides/appeal/payoff-simulator.svg new file mode 100644 index 000000000..c01b0acf7 --- /dev/null +++ b/web/src/assets/svgs/mini-guides/appeal/payoff-simulator.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/appeal/stage-one.svg b/web/src/assets/svgs/mini-guides/appeal/stage-one.svg new file mode 100644 index 000000000..fe3933e8d --- /dev/null +++ b/web/src/assets/svgs/mini-guides/appeal/stage-one.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/appeal/stage-two.svg b/web/src/assets/svgs/mini-guides/appeal/stage-two.svg new file mode 100644 index 000000000..acea9b8a3 --- /dev/null +++ b/web/src/assets/svgs/mini-guides/appeal/stage-two.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/binary-voting/voting-module.svg b/web/src/assets/svgs/mini-guides/binary-voting/voting-module.svg new file mode 100644 index 000000000..791289b53 --- /dev/null +++ b/web/src/assets/svgs/mini-guides/binary-voting/voting-module.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/onboarding/how-it-works.svg b/web/src/assets/svgs/mini-guides/onboarding/how-it-works.svg new file mode 100644 index 000000000..c4fdd0567 --- /dev/null +++ b/web/src/assets/svgs/mini-guides/onboarding/how-it-works.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/onboarding/what-do-i-need.svg b/web/src/assets/svgs/mini-guides/onboarding/what-do-i-need.svg new file mode 100644 index 000000000..97f325c4e --- /dev/null +++ b/web/src/assets/svgs/mini-guides/onboarding/what-do-i-need.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/ranked-voting/voting-module.svg b/web/src/assets/svgs/mini-guides/ranked-voting/voting-module.svg new file mode 100644 index 000000000..feea37c68 --- /dev/null +++ b/web/src/assets/svgs/mini-guides/ranked-voting/voting-module.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/staking/court-header.svg b/web/src/assets/svgs/mini-guides/staking/court-header.svg new file mode 100644 index 000000000..f8ef2664c --- /dev/null +++ b/web/src/assets/svgs/mini-guides/staking/court-header.svg @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/staking/juror-rewards.svg b/web/src/assets/svgs/mini-guides/staking/juror-rewards.svg new file mode 100644 index 000000000..49a3777da --- /dev/null +++ b/web/src/assets/svgs/mini-guides/staking/juror-rewards.svg @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/staking/notifications.svg b/web/src/assets/svgs/mini-guides/staking/notifications.svg new file mode 100644 index 000000000..8fd69c1fd --- /dev/null +++ b/web/src/assets/svgs/mini-guides/staking/notifications.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/mini-guides/staking/staking-section.svg b/web/src/assets/svgs/mini-guides/staking/staking-section.svg new file mode 100644 index 000000000..faafd141e --- /dev/null +++ b/web/src/assets/svgs/mini-guides/staking/staking-section.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/assets/svgs/styled/pnk.svg b/web/src/assets/svgs/styled/pnk.svg index 56a546d4c..f48cfb58f 100644 --- a/web/src/assets/svgs/styled/pnk.svg +++ b/web/src/assets/svgs/styled/pnk.svg @@ -1,9 +1,9 @@ - - + + - - - + + + diff --git a/web/src/components/CasesDisplay/Search.tsx b/web/src/components/CasesDisplay/Search.tsx index 6bb6e4b5f..42c911d58 100644 --- a/web/src/components/CasesDisplay/Search.tsx +++ b/web/src/components/CasesDisplay/Search.tsx @@ -1,7 +1,8 @@ import React, { useMemo, useState } from "react"; +import styled, { css } from "styled-components"; +import { landscapeStyle } from "styles/landscapeStyle"; import { useNavigate, useParams } from "react-router-dom"; import { useDebounce } from "react-use"; -import styled from "styled-components"; import Skeleton from "react-loading-skeleton"; import { Searchbar, DropdownCascader } from "@kleros/ui-components-library"; import { rootCourtToItems, useCourtTree } from "queries/useCourtTree"; @@ -9,6 +10,21 @@ import { isUndefined } from "utils/index"; import { decodeURIFilter, encodeURIFilter, useRootPath } from "utils/uri"; const Container = styled.div` + display: flex; + flex-direction: column; + gap: 4px; + + ${landscapeStyle( + () => + css` + flex-direction: row; + gap: calc(4px + (22 - 4) * (min(max(100vw, 375px), 1250px) - 375px) / 875); + ` + )} +`; + +const SearchBarContainer = styled.div` + width: 100%; display: flex; flex-wrap: wrap; gap: 8px; @@ -54,15 +70,7 @@ const Search: React.FC = () => { }, [courtTreeData]); return ( -
- - setSearch(e.target.value)} - /> - + {items ? ( { ) : ( )} -
+ + setSearch(e.target.value)} + /> + + ); }; diff --git a/web/src/components/CasesDisplay/Stats.tsx b/web/src/components/CasesDisplay/Stats.tsx index a3b04193e..9f453692d 100644 --- a/web/src/components/CasesDisplay/Stats.tsx +++ b/web/src/components/CasesDisplay/Stats.tsx @@ -7,13 +7,17 @@ const FieldWrapper = styled.div` `; const SeparatorLabel = styled.label` - margin-left: 8px; - margin-right: 8px; + margin: 0 8px; + color: ${({ theme }) => theme.primaryText}; +`; + +const StyledLabel = styled.label` + color: ${({ theme }) => theme.primaryText}; `; const Field: React.FC<{ label: string; value: string }> = ({ label, value }) => ( - + {label} {value} ); diff --git a/web/src/components/CasesDisplay/StatsAndFilters.tsx b/web/src/components/CasesDisplay/StatsAndFilters.tsx index 3d878aeb7..42af83f81 100644 --- a/web/src/components/CasesDisplay/StatsAndFilters.tsx +++ b/web/src/components/CasesDisplay/StatsAndFilters.tsx @@ -7,7 +7,8 @@ const Container = styled.div` display: flex; flex-wrap: wrap; gap: 8px; - margin-top: 8px; + margin-top: 11px; + justify-content: space-between; `; const StatsAndFilters: React.FC = ({ totalDisputes, closedDisputes }) => ( diff --git a/web/src/components/CasesDisplay/index.tsx b/web/src/components/CasesDisplay/index.tsx index 5a50795ca..ed02354f7 100644 --- a/web/src/components/CasesDisplay/index.tsx +++ b/web/src/components/CasesDisplay/index.tsx @@ -4,9 +4,16 @@ import Search from "./Search"; import StatsAndFilters from "./StatsAndFilters"; import CasesGrid, { ICasesGrid } from "./CasesGrid"; -const StyledHR = styled.hr` - margin-top: 24px; - margin-bottom: 24px; +const Divider = styled.hr` + display: flex; + border: none; + height: 1px; + background-color: ${({ theme }) => theme.stroke}; + margin: calc(20px + (24 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875) 0; +`; + +const StyledTitle = styled.h1` + margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875); `; interface ICasesDisplay extends ICasesGrid { @@ -29,10 +36,10 @@ const CasesDisplay: React.FC = ({ }) => { return (
-

{title}

+ {title} - + {disputes?.length === 0 ? (

No cases found

diff --git a/web/src/pages/Home/TopJurors/Header/HowItWorks.tsx b/web/src/components/HowItWorks.tsx similarity index 53% rename from web/src/pages/Home/TopJurors/Header/HowItWorks.tsx rename to web/src/components/HowItWorks.tsx index 36cd00bf0..6791b400c 100644 --- a/web/src/pages/Home/TopJurors/Header/HowItWorks.tsx +++ b/web/src/components/HowItWorks.tsx @@ -1,19 +1,22 @@ import React from "react"; import styled from "styled-components"; -import { useToggle } from "react-use"; import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg"; -import Level from "components/Popup/MiniGuides/Level"; const Container = styled.div` display: flex; align-items: center; gap: 8px; + color: ${({ theme }) => theme.primaryBlue}; &, & * { cursor: pointer; } + &:hover { + text-decoration: underline; + } + svg { path { fill: ${({ theme }) => theme.primaryBlue}; @@ -25,15 +28,20 @@ const StyledLabel = styled.label` color: ${({ theme }) => theme.primaryBlue}; `; -const HowItWorks: React.FC = () => { - const [isLevelMiniGuidesOpen, toggleIsLevelMiniGuidesOpen] = useToggle(false); +interface IHowItWorks { + isMiniGuideOpen: boolean; + toggleMiniGuide: () => void; + MiniGuideComponent: React.ComponentType<{ toggleMiniGuide: () => void }>; +} + +const HowItWorks: React.FC = ({ isMiniGuideOpen, toggleMiniGuide, MiniGuideComponent }) => { return ( <> - toggleIsLevelMiniGuidesOpen()}> + How it works - {isLevelMiniGuidesOpen && } + {isMiniGuideOpen && } ); }; diff --git a/web/src/components/Popup/MiniGuides/Appeal/CrowdfundAppeal.tsx b/web/src/components/Popup/MiniGuides/Appeal/CrowdfundAppeal.tsx new file mode 100644 index 000000000..cf2fcadd9 --- /dev/null +++ b/web/src/components/Popup/MiniGuides/Appeal/CrowdfundAppeal.tsx @@ -0,0 +1,38 @@ +import React from "react"; +import styled from "styled-components"; +import CrowdfundAppealSvg from "tsx:assets/svgs/mini-guides/appeal/crowdfund-appeal.svg"; +import { StyledImage } from "../PageContentsTemplate"; + +const StyledCrowdfundAppealSvg = styled(CrowdfundAppealSvg)` + [class$="rect-bg"] { + fill: ${({ theme }) => theme.whiteBackground}; + stroke: ${({ theme }) => theme.stroke}; + } + + [class$="path-1"], + [class$="path-2"], + [class$="path-3"] { + fill: ${({ theme }) => theme.primaryText}; + } + + [class$="rect-fg"] { + fill: ${({ theme }) => theme.whiteBackground}; + stroke: ${({ theme }) => theme.stroke}; + } + + [class$="rect-accent"] { + fill: ${({ theme }) => theme.primaryBlue}; + } + + [class$="path-4"] { + fill: ${({ theme }) => theme.whiteBackground}; + } + + [class$="path-5"] { + fill: ${({ theme }) => theme.secondaryText}; + } +`; + +const CrowdfundAppeal: React.FC = () => ; + +export default CrowdfundAppeal; diff --git a/web/src/components/Popup/MiniGuides/Appeal/PayoffSimulator.tsx b/web/src/components/Popup/MiniGuides/Appeal/PayoffSimulator.tsx new file mode 100644 index 000000000..7e0a16680 --- /dev/null +++ b/web/src/components/Popup/MiniGuides/Appeal/PayoffSimulator.tsx @@ -0,0 +1,77 @@ +import React from "react"; +import styled from "styled-components"; +import PayoffSimulatorSvg from "tsx:assets/svgs/mini-guides/appeal/payoff-simulator.svg"; +import { StyledImage } from "../PageContentsTemplate"; + +const StyledPayoffSimulatorSvg = styled(PayoffSimulatorSvg)` + [class$="circle-1"] { + fill: ${({ theme }) => theme.successLight}; + } + + [class$="rect-2"] { + fill: ${({ theme }) => theme.mediumBlue}; + } + + [class$="circle-2"] { + fill: ${({ theme }) => theme.mediumPurple}; + } + + [class$="rect-1"], + [class$="rect-5"] { + fill: ${({ theme }) => theme.whiteBackground}; + stroke: ${({ theme }) => theme.stroke}; + } + + [class$="rect-6"], + [class$="rect-7"], + [class$="rect-8"] { + fill: ${({ theme }) => theme.white}; + } + + [class$="path-2"] { + fill: ${({ theme }) => theme.success}; + } + + [class$="path-3"], + [class$="path-16"] { + fill: ${({ theme }) => theme.secondaryPurple}; + } + + [class$="path-11"], + [class$="path-13"] { + fill: ${({ theme }) => theme.whiteBackground}; + } + + [class$="path-4"], + [class$="path-5"], + [class$="path-6"], + [class$="path-7"], + [class$="path-8"], + [class$="path-9"], + [class$="path-10"], + [class$="path-12"], + [class$="path-14"], + [class$="path-15"], + [class$="path-17"] { + fill: ${({ theme }) => theme.primaryText}; + } + + [class$="rect-3"], + [class$="rect-4"] { + fill: ${({ theme }) => theme.primaryBlue}; + } + + [class$="line-1"], + [class$="line-2"], + [class$="path-1"] { + stroke: ${({ theme }) => theme.mediumBlue}; + } + + [class$="path-1"] { + fill: ${({ theme }) => theme.lightBlue}; + } +`; + +const PayoffSimulator: React.FC = () => ; + +export default PayoffSimulator; diff --git a/web/src/components/Popup/MiniGuides/Appeal/StageOne.tsx b/web/src/components/Popup/MiniGuides/Appeal/StageOne.tsx new file mode 100644 index 000000000..fe6d47047 --- /dev/null +++ b/web/src/components/Popup/MiniGuides/Appeal/StageOne.tsx @@ -0,0 +1,74 @@ +import React from "react"; +import styled from "styled-components"; +import StageOneSvg from "tsx:assets/svgs/mini-guides/appeal/stage-one.svg"; +import { StyledImage } from "../PageContentsTemplate"; + +const StyledStageOneSvg = styled(StageOneSvg)` + [class$="rect-1"], + [class$="rect-2"], + [class$="rect-6"], + [class$="circle-1"], + [class$="circle-2"] { + fill: ${({ theme }) => theme.whiteBackground}; + } + + [class$="rect-4"], + [class$="rect-8"] { + fill: ${({ theme }) => theme.stroke}; + } + + [class$="rect-5"], + [class$="path-9"], + [class$="path-10"] { + fill: ${({ theme }) => theme.secondaryPurple}; + } + + [class$="rect-9"], + [class$="circle-3"] { + fill: ${({ theme }) => theme.primaryBlue}; + } + + [class$="rect-10"] { + fill: ${({ theme }) => theme.lightBlue}; + stroke: ${({ theme }) => theme.mediumBlue}; + } + + [class$="rect-11"], + [class$="rect-12"] { + fill: ${({ theme }) => theme.white}; + } + + [class$="path-2"], + [class$="path-6"] { + fill: ${({ theme }) => theme.primaryText}; + } + + [class$="path-1"], + [class$="path-5"] { + fill: ${({ theme }) => theme.secondaryText}; + } + + [class$="path-3"], + [class$="path-4"] { + fill: ${({ theme }) => theme.success}; + } + + [class$="path-7"], + [class$="path-8"] { + fill: ${({ theme }) => theme.warning}; + } + + [class$="rect-3"], + [class$="rect-7"], + [class$="circle-1"] { + stroke: ${({ theme }) => theme.stroke}; + } + + [class$="circle-2"] { + stroke: ${({ theme }) => theme.primaryBlue}; + } +`; + +const StageOne: React.FC = () => ; + +export default StageOne; diff --git a/web/src/components/Popup/MiniGuides/Appeal/StageTwo.tsx b/web/src/components/Popup/MiniGuides/Appeal/StageTwo.tsx new file mode 100644 index 000000000..f625d0034 --- /dev/null +++ b/web/src/components/Popup/MiniGuides/Appeal/StageTwo.tsx @@ -0,0 +1,55 @@ +import React from "react"; +import styled from "styled-components"; +import StageTwoSvg from "tsx:assets/svgs/mini-guides/appeal/stage-two.svg"; +import { StyledImage } from "../PageContentsTemplate"; + +const StyledStageTwoSvg = styled(StageTwoSvg)` + [class$="rect-1"] { + fill: ${({ theme }) => theme.whiteBackground}; + } + + [class$="rect-2"], + [class$="rect-6"] { + fill: ${({ theme }) => theme.lightBlue}; + stroke: ${({ theme }) => theme.mediumBlue}; + } + + [class$="rect-3"], + [class$="path-2"], + [class$="path-3"] { + fill: ${({ theme }) => theme.success}; + } + + [class$="rect-4"] { + fill: ${({ theme }) => theme.stroke}; + } + + [class$="rect-5"] { + fill: ${({ theme }) => theme.primaryBlue}; + } + + [class$="rect-7"] { + fill: ${({ theme }) => theme.white}; + } + + [class$="rect-6"], + [class$="line-1"] { + stroke: ${({ theme }) => theme.mediumBlue}; + } + + [class$="path-1"], + [class$="path-4"], + [class$="path-5"], + [class$="path-6"] { + fill: ${({ theme }) => theme.primaryText}; + } + + [class$="path-7"], + [class$="path-8"] { + fill: ${({ theme }) => theme.secondaryPurple}; + } +`; + +const StageTwo: React.FC = () => ; + +export default StageTwo; diff --git a/web/src/components/Popup/MiniGuides/Appeal/index.tsx b/web/src/components/Popup/MiniGuides/Appeal/index.tsx new file mode 100644 index 000000000..fbd1da38f --- /dev/null +++ b/web/src/components/Popup/MiniGuides/Appeal/index.tsx @@ -0,0 +1,59 @@ +import React from "react"; +import CrowdfundAppeal from "./CrowdfundAppeal"; +import PayoffSimulator from "./PayoffSimulator"; +import StageOne from "./StageOne"; +import StageTwo from "./StageTwo"; +import PageContentsTemplate from "../PageContentsTemplate"; + +const leftPageContents = [ + { + title: "Appeal", + paragraphs: [ + "If after the jury has reached a decision, a party is not satisfied (because she thinks the result was" + + " unfair), she can appeal and have the dispute ruled again. Each new appeal instance will have twice the" + + " previous number of jurors plus one.", + ], + }, + { + title: "Appeal: Stage 1", + paragraphs: [ + "The jury decision is appealed when stages 1 and 2 are fully funded. In stage 1, one of the losing options" + + " must be fully funded. If no option is fully funded in time the jury decision is maintained.", + ], + }, + { + title: "Appeal: Stage 2", + paragraphs: [ + "Now, options compete together against the option fully funded at stage 1. The sum of funds must reach 100%." + + " If it's not fully funded in time the option fully funded at stage 1 is declared the winner of the case. ", + ], + }, + { + title: "Crowdfunding Rewards", + paragraphs: [ + "Anyone can contribute to the crowdfunding of the appeal fees. Crowdfunders can win rewards in case the option" + + " they fund wins. See how much you can earn by funding appeals, at the payoff simulator.", + ], + }, +]; + +const rightPageComponents = [CrowdfundAppeal, StageOne, StageTwo, PayoffSimulator]; + +interface IAppeal { + toggleMiniGuide: () => void; +} + +const Appeal: React.FC = ({ toggleMiniGuide }) => { + return ( + + ); +}; + +export default Appeal; diff --git a/web/src/components/Popup/MiniGuides/BinaryVoting/VotingModule.tsx b/web/src/components/Popup/MiniGuides/BinaryVoting/VotingModule.tsx new file mode 100644 index 000000000..fcb7a4938 --- /dev/null +++ b/web/src/components/Popup/MiniGuides/BinaryVoting/VotingModule.tsx @@ -0,0 +1,39 @@ +import React from "react"; +import styled from "styled-components"; +import VotingModuleSvg from "tsx:assets/svgs/mini-guides/binary-voting/voting-module.svg"; +import { StyledImage } from "../PageContentsTemplate"; + +const StyledVotingModuleSvg = styled(VotingModuleSvg)` + [class$="rect-1"], + [class$="rect-4"], + [class$="path-1"], + [class$="path-2"] { + fill: ${({ theme }) => theme.whiteBackground}; + } + + [class$="rect-2"], + [class$="rect-3"], + [class$="path-4"] { + fill: ${({ theme }) => theme.primaryBlue}; + } + + [class$="path-3"] { + fill: ${({ theme }) => theme.lightBlue}; + } + + [class$="path-5"] { + fill: ${({ theme }) => theme.secondaryText}; + } + + [class$="rect-1"] { + stroke: ${({ theme }) => theme.stroke}; + } + + [class$="rect-5"] { + stroke: ${({ theme }) => theme.primaryBlue}; + } +`; + +const VotingModule: React.FC = () => ; + +export default VotingModule; diff --git a/web/src/components/Popup/MiniGuides/BinaryVoting/index.tsx b/web/src/components/Popup/MiniGuides/BinaryVoting/index.tsx new file mode 100644 index 000000000..484cfc690 --- /dev/null +++ b/web/src/components/Popup/MiniGuides/BinaryVoting/index.tsx @@ -0,0 +1,45 @@ +import React from "react"; +import PageContentsTemplate from "../PageContentsTemplate"; +import JurorRewards from "../Staking/JurorRewards"; +import VotingModule from "./VotingModule"; + +const leftPageContents = [ + { + title: "Binary Voting", + paragraphs: [ + "Jurors choose one option to vote. The option which receives the majority of votes is considered the winner.", + "Refuse to Arbitrate is used when a dispute has been posted in the wrong court, has no clear outcome, or" + + " evidence is immoral and/or illegal. In case the majority decides to Refuse to Arbitrate, that option" + + " is considered the winner.", + ], + }, + { + title: "Juror Rewards", + paragraphs: [ + "Jurors whose vote is coherent with the final jury decision (after all the appeal instances) receive the" + + " Juror Rewards composed of arbitration fees (ETH) + PNK redistribution between jurors. Jurors whose vote" + + " is not coherent with the final jury decision, lose their locked PNK.", + ], + }, +]; + +const rightPageComponents = [VotingModule, JurorRewards]; + +interface IBinaryVoting { + toggleMiniGuide: () => void; +} + +const BinaryVoting: React.FC = ({ toggleMiniGuide }) => { + return ( + + ); +}; + +export default BinaryVoting; diff --git a/web/src/components/Popup/MiniGuides/Level.tsx b/web/src/components/Popup/MiniGuides/JurorLevels.tsx similarity index 50% rename from web/src/components/Popup/MiniGuides/Level.tsx rename to web/src/components/Popup/MiniGuides/JurorLevels.tsx index 5e9c94ad4..4ab5cf292 100644 --- a/web/src/components/Popup/MiniGuides/Level.tsx +++ b/web/src/components/Popup/MiniGuides/JurorLevels.tsx @@ -4,7 +4,8 @@ import { landscapeStyle } from "styles/landscapeStyle"; import { Card as _Card } from "@kleros/ui-components-library"; import PixelArt from "pages/Dashboard/JurorInfo/PixelArt"; import Coherency from "pages/Dashboard/JurorInfo/Coherency"; -import Template from "./Template"; +import { Title, ParagraphsContainer, LeftContentContainer } from "./PageContentsTemplate"; +import Template from "./MainStructureTemplate"; const Card = styled(_Card)` display: flex; @@ -25,100 +26,118 @@ const Card = styled(_Card)` )} `; -const Title = styled.h1` - margin-bottom: 0; -`; - -const LeftContentContainer = styled.div` - display: flex; - gap: 18px; - flex-direction: column; -`; +const leftPageContents = [ + { + title: "Juror Level 1: Phytagoras", + 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.", + ], + }, + { + title: "Juror Level 2: Socrates", + paragraphs: ["Level 2: Jurors with ≥ 3 cases arbitrated with 70%-80% of coherent votes."], + }, + { + title: "Juror Level 3: Plato", + paragraphs: ["Level 3: Jurors with ≥ 7 cases arbitrated with 80%-90% of coherent votes."], + }, + { + title: "Juror Level 4: Aristotle", + paragraphs: ["Level 4: Jurors with ≥ 10 cases arbitrated with more than 90% of coherent votes."], + }, + { + title: "Juror Level 0: Diogenes", + paragraphs: [ + "There's a level for the low-performance/lazy jurors. Level 0: Jurors with ≥ 3 cases arbitrated" + + " with less than 50% of coherent votes.", + ], + }, +]; const userLevelData = [ { level: 1, - title: "Pythagoras", + title: "Phytagoras", totalCoherent: 6, totalResolvedDisputes: 10, - firstParagraph: "Jurors are classified into distinct levels according to their performance starting from Level 1.", - secondParagraph: - "Level 1: Jurors with 0 cases arbitrated, OR Jurors with ≥ 1 case arbitrated with 0-70% of coherent votes.", }, { level: 2, title: "Socrates", totalCoherent: 7, totalResolvedDisputes: 10, - firstParagraph: "Level 2: Jurors with ≥ 3 cases arbitrated with 70%-80% of coherent votes.", }, { level: 3, title: "Plato", totalCoherent: 8, totalResolvedDisputes: 10, - firstParagraph: "Level 3: Jurors with ≥ 7 cases arbitrated with 80%-90% of coherent votes.", }, { level: 4, - title: "Aristoteles", + title: "Aristotle", totalCoherent: 9, totalResolvedDisputes: 10, - firstParagraph: "Level 4: Jurors with ≥ 10 cases arbitrated with more than 90% of coherent votes.", }, { level: 0, title: "Diogenes", totalCoherent: 3, totalResolvedDisputes: 10, - firstParagraph: - "There's a level for the low-performance/lazy jurors. Level 0: Jurors with ≥ 3 cases arbitrated with less than 50% of coherent votes.", }, ]; const LeftContent: React.FC<{ currentPage: number }> = ({ currentPage }) => { + const { title, paragraphs } = leftPageContents[currentPage - 1]; + return ( - - Juror Level {userLevelData[currentPage - 1].level}: {userLevelData[currentPage - 1].title} - - - + {title} + + {paragraphs.map((paragraph, index) => ( + + ))} + ); }; const RightContent: React.FC<{ currentPage: number }> = ({ currentPage }) => { + const userData = userLevelData[currentPage - 1]; return ( - + ); }; -interface ILevel { - toggleIsLevelMiniGuidesOpen: () => void; +interface IJurorLevels { + toggleMiniGuide: () => void; } -const Level: React.FC = ({ toggleIsLevelMiniGuidesOpen }) => { +const JurorLevels: React.FC = ({ toggleMiniGuide }) => { const [currentPage, setCurrentPage] = useState(1); return (