File tree 2 files changed +11
-6
lines changed
web/src/pages/Home/TopJurors
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const Container = styled.div`
11
11
display: flex;
12
12
font-size: 12px !important;
13
13
&::before {
14
- content: "Votes ";
14
+ content: "Coherency ";
15
15
}
16
16
color: ${ ( { theme } ) => theme . secondaryText } ;
17
17
align-items: center;
@@ -21,15 +21,13 @@ const Container = styled.div`
21
21
css `
22
22
font-size: 14px !important;
23
23
justify-content: center;
24
- &::before {
25
- content: "Coherent Votes";
26
- }
27
24
`
28
25
) }
29
26
` ;
30
27
31
28
const coherentVotesTooltipMsg =
32
- "This is the ratio of coherent votes made by a juror: " +
29
+ "This is the percentage of coherent votes made by a juror." +
30
+ " Hover to see the ratio of coherent votes : " +
33
31
"the number in the left is the number of times where the juror " +
34
32
"voted coherently and the number in the right is the total number of times " +
35
33
"the juror voted" ;
Original file line number Diff line number Diff line change
1
+ import { Tooltip } from "@kleros/ui-components-library" ;
1
2
import React from "react" ;
2
3
import styled from "styled-components" ;
3
4
@@ -18,7 +19,13 @@ interface ICoherency {
18
19
const Coherency : React . FC < ICoherency > = ( { totalCoherentVotes, totalResolvedVotes } ) => {
19
20
const coherenceRatio = `${ totalCoherentVotes } /${ totalResolvedVotes } ` ;
20
21
21
- return < Container > { coherenceRatio } </ Container > ;
22
+ return (
23
+ < Container >
24
+ < Tooltip text = { coherenceRatio } > { getPercent ( totalCoherentVotes , totalResolvedVotes ) } </ Tooltip >
25
+ </ Container >
26
+ ) ;
22
27
} ;
23
28
29
+ const getPercent = ( num : number , den : number ) : string => `${ Math . floor ( ( num * 100 ) / den ) } %` ;
30
+
24
31
export default Coherency ;
You can’t perform that action at this time.
0 commit comments