diff --git a/web/src/pages/Dashboard/JurorInfo/Header.tsx b/web/src/pages/Dashboard/JurorInfo/Header.tsx index f6bd112ce..5ffc27995 100644 --- a/web/src/pages/Dashboard/JurorInfo/Header.tsx +++ b/web/src/pages/Dashboard/JurorInfo/Header.tsx @@ -36,9 +36,17 @@ const StyledLink = styled.a` } `; -const Header: React.FC = () => { +interface IHeader { + levelTitle: string; + levelNumber: number; + totalCoherent: number; + totalResolvedDisputes: number; +} + +const Header: React.FC = ({ levelTitle, levelNumber, totalCoherent, totalResolvedDisputes }) => { + const coherencePercentage = parseFloat(((totalCoherent / Math.max(totalResolvedDisputes, 1)) * 100).toFixed(2)); const courtUrl = window.location.origin; - const xPostText = `Hey I've been busy as a Juror on the Kleros court, check out my score: Level: 2 (Diogenes). Coherence score: 8. Be a juror with me -> ${courtUrl}`; + const xPostText = `Hey I've been busy as a Juror on the Kleros court, check out my score: \n\nLevel: ${levelNumber} (${levelTitle})\nCoherent Votes: ${totalCoherent}/${totalResolvedDisputes}\nCoherence Percentage: ${coherencePercentage}%\n\nBe a juror with me -> ${courtUrl}`; const xShareUrl = `https://twitter.com/intent/tweet?text=${encodeURIComponent(xPostText)}`; return ( diff --git a/web/src/pages/Dashboard/JurorInfo/index.tsx b/web/src/pages/Dashboard/JurorInfo/index.tsx index 7ad1701a1..ffefa5a9d 100644 --- a/web/src/pages/Dashboard/JurorInfo/index.tsx +++ b/web/src/pages/Dashboard/JurorInfo/index.tsx @@ -44,7 +44,12 @@ const JurorInfo: React.FC = () => { return ( -
+