Skip to content

Commit 1639d2a

Browse files
authored
Merge pull request #590 from kleros/feat/display-court-votes-info
feat: add voting type tooltip to court information
2 parents 1f77ccb + 7a4d2ae commit 1639d2a

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

src/components/court-cascader-modal.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, Cascader, Col, Modal, Row, Skeleton, Tooltip, Typography } from "antd";
1+
import { Button, Cascader, Col, Icon, Modal, Row, Skeleton, Tooltip, Typography } from "antd";
22
import React, { useCallback, useState } from "react";
33
import PropTypes from "prop-types";
44
import ReactMarkdown from "react-markdown";
@@ -151,6 +151,23 @@ const CourtCascaderModal = ({ onClick }) => {
151151
tokenSymbol="PNK"
152152
/>
153153
.
154+
{_court !== null && (
155+
<>
156+
{" | "}
157+
<Tooltip
158+
title={
159+
_court.hiddenVotes
160+
? "Jurors in this court must commit their vote first and reveal it later."
161+
: "Jurors in this court cast their vote in a single step, visible to others."
162+
}
163+
>
164+
<StyledVoteTypeDisplay>
165+
<span>{_court.hiddenVotes ? "Hidden votes" : "Public votes"}</span>
166+
<StyledInfoIcon type="info-circle" theme="filled" />
167+
</StyledVoteTypeDisplay>
168+
</Tooltip>
169+
</>
170+
)}
154171
</StyledMinStakeDisplay>
155172
</Typography.Title>
156173
<ReactMarkdown source={option.description} />
@@ -425,3 +442,16 @@ const StyledMinStakeDisplay = styled.div`
425442
font-size: 12px;
426443
margin: 3px 0 20px 0;
427444
`;
445+
446+
const StyledVoteTypeDisplay = styled.span`
447+
cursor: help;
448+
449+
span {
450+
border-bottom: 1px dotted currentColor;
451+
}
452+
`;
453+
454+
const StyledInfoIcon = styled(Icon)`
455+
margin-left: 4px;
456+
vertical-align: middle;
457+
`;

0 commit comments

Comments
 (0)