|
| 1 | +import React from "react"; |
| 2 | +import styled, { css } from "styled-components"; |
| 3 | +import { landscapeStyle } from "styles/landscapeStyle"; |
| 4 | +import WithHelpTooltip from "pages/Dashboard/WithHelpTooltip"; |
| 5 | +import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg"; |
| 6 | + |
| 7 | +const Container = styled.div` |
| 8 | + display: flex; |
| 9 | + justify-content: space-between; |
| 10 | + |
| 11 | + width: 100%; |
| 12 | + height: 100%; |
| 13 | + background-color: ${({ theme }) => theme.lightBlue}; |
| 14 | + padding: 18.5px 32px; |
| 15 | + border 1px solid ${({ theme }) => theme.stroke}; |
| 16 | + border-top-left-radius: 3px; |
| 17 | + border-top-right-radius: 3px; |
| 18 | +`; |
| 19 | + |
| 20 | +const JurorData = styled.div` |
| 21 | + display: flex; |
| 22 | + align-items: center; |
| 23 | + justify-content: space-between; |
| 24 | + width: 100%; |
| 25 | + flex-wrap: wrap; |
| 26 | + gap: calc(24px + (48 - 24) * ((100vw - 300px) / (1250 - 300))); |
| 27 | +`; |
| 28 | + |
| 29 | +const JurorTitle = styled.div` |
| 30 | + display: none; |
| 31 | + gap: 36px; |
| 32 | + align-items: center; |
| 33 | + label { |
| 34 | + font-weight: 400; |
| 35 | + font-size: 14px; |
| 36 | + line-height: 19px; |
| 37 | + color: ${({ theme }) => theme.secondaryText} !important; |
| 38 | + } |
| 39 | +
|
| 40 | + ${landscapeStyle( |
| 41 | + () => |
| 42 | + css` |
| 43 | + display: flex; |
| 44 | + width: 372px; |
| 45 | + ` |
| 46 | + )} |
| 47 | +`; |
| 48 | + |
| 49 | +const RewardsAndCoherency = styled.div` |
| 50 | + display: flex; |
| 51 | + gap: calc(52px + (104 - 52) * (min(max(100vw, 375px), 1250px) - 375px) / 875); |
| 52 | +`; |
| 53 | + |
| 54 | +const Rewards = styled.div` |
| 55 | + width: 132px; |
| 56 | +`; |
| 57 | + |
| 58 | +const HowItWorks = styled.div` |
| 59 | + display: flex; |
| 60 | + align-items: center; |
| 61 | + gap: 8px; |
| 62 | +
|
| 63 | + label { |
| 64 | + color: ${({ theme }) => theme.primaryBlue}; |
| 65 | + } |
| 66 | +
|
| 67 | + svg { |
| 68 | + path { |
| 69 | + fill: ${({ theme }) => theme.primaryBlue}; |
| 70 | + } |
| 71 | + } |
| 72 | +`; |
| 73 | + |
| 74 | +const totalRewardsTooltipMsg = |
| 75 | + "Users have an economic interest in serving as jurors in Kleros: " + |
| 76 | + "collecting the Juror Rewards in exchange for their work. Each juror who " + |
| 77 | + "is coherent with the final ruling receive the Juror Rewards composed of " + |
| 78 | + "arbitration fees (ETH) + PNK redistribution between jurors."; |
| 79 | + |
| 80 | +const coherentVotesTooltipMsg = |
| 81 | + "This is the ratio of coherent votes made by a juror: " + |
| 82 | + "the number in the left is the number of times where the juror " + |
| 83 | + "voted coherently and the number in the right is the total number of times " + |
| 84 | + "the juror voted"; |
| 85 | + |
| 86 | +const TopJurorsHeader: React.FC = () => { |
| 87 | + return ( |
| 88 | + <Container> |
| 89 | + <JurorTitle> |
| 90 | + <label>#</label> |
| 91 | + <label>Juror</label> |
| 92 | + </JurorTitle> |
| 93 | + <JurorData> |
| 94 | + <RewardsAndCoherency> |
| 95 | + <Rewards> |
| 96 | + <WithHelpTooltip place="top" tooltipMsg={totalRewardsTooltipMsg}> |
| 97 | + <label> Total Rewards </label> |
| 98 | + </WithHelpTooltip> |
| 99 | + </Rewards> |
| 100 | + |
| 101 | + <WithHelpTooltip place="top" tooltipMsg={coherentVotesTooltipMsg}> |
| 102 | + <label> Coherent Votes </label> |
| 103 | + </WithHelpTooltip> |
| 104 | + </RewardsAndCoherency> |
| 105 | + <HowItWorks> |
| 106 | + <BookOpenIcon /> |
| 107 | + <label> How it works </label> |
| 108 | + </HowItWorks> |
| 109 | + </JurorData> |
| 110 | + </Container> |
| 111 | + ); |
| 112 | +}; |
| 113 | + |
| 114 | +export default TopJurorsHeader; |
0 commit comments