Skip to content

Commit 40fe52d

Browse files
committed
fix: coherency to coherence and redirect to policy section instead of purpose
1 parent 108a6c4 commit 40fe52d

File tree

11 files changed

+42
-44
lines changed

11 files changed

+42
-44
lines changed

web/src/components/DisputePreview/Policies.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const Policies: React.FC<IPolicies> = ({ disputePolicyURI, courtId, attac
9898
</StyledInternalLink>
9999
)}
100100
{isUndefined(courtId) ? null : (
101-
<StyledInternalLink to={`/courts/${courtId}/purpose?section=description`}>
101+
<StyledInternalLink to={`/courts/${courtId}/policy?section=description`}>
102102
<StyledPolicyIcon />
103103
Court Policy
104104
</StyledInternalLink>

web/src/components/Popup/MiniGuides/JurorLevels.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Card as _Card } from "@kleros/ui-components-library";
55

66
import { landscapeStyle } from "styles/landscapeStyle";
77

8-
import Coherency from "pages/Dashboard/JurorInfo/Coherency";
8+
import Coherence from "pages/Dashboard/JurorInfo/Coherence";
99
import PixelArt from "pages/Dashboard/JurorInfo/PixelArt";
1010

1111
import Template from "./MainStructureTemplate";
@@ -112,7 +112,7 @@ const RightContent: React.FC<{ currentPage: number }> = ({ currentPage }) => {
112112
return (
113113
<Card>
114114
<PixelArt level={userData.level} width="189px" height="189px" />
115-
<Coherency
115+
<Coherence
116116
userLevelData={userData}
117117
totalCoherentVotes={userData.totalCoherentVotes}
118118
totalResolvedVotes={userData.totalResolvedVotes}

web/src/pages/Dashboard/JurorInfo/Coherency.tsx web/src/pages/Dashboard/JurorInfo/Coherence.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const tooltipMsg =
2525
" (after all the appeal instances). If the juror vote is the same as " +
2626
" the majority of jurors it's considered a Coherent Vote.";
2727

28-
interface ICoherency {
28+
interface ICoherence {
2929
userLevelData: {
3030
level: number;
3131
title: string;
@@ -35,7 +35,7 @@ interface ICoherency {
3535
isMiniGuide: boolean;
3636
}
3737

38-
const Coherency: React.FC<ICoherency> = ({ userLevelData, totalCoherentVotes, totalResolvedVotes, isMiniGuide }) => {
38+
const Coherence: React.FC<ICoherence> = ({ userLevelData, totalCoherentVotes, totalResolvedVotes, isMiniGuide }) => {
3939
const votesContent = (
4040
<label>
4141
Coherent Votes:
@@ -64,4 +64,4 @@ const Coherency: React.FC<ICoherency> = ({ userLevelData, totalCoherentVotes, to
6464
);
6565
};
6666

67-
export default Coherency;
67+
export default Coherence;

web/src/pages/Dashboard/JurorInfo/StakingRewards.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const tooltipMsg =
4848
"Staking Rewards are the rewards won by staking your PNK on a court during " +
4949
"the Kleros' Jurors incentive program.";
5050

51-
const Coherency: React.FC = () => {
51+
const Coherence: React.FC = () => {
5252
return (
5353
<Container>
5454
<WithHelpTooltip place="bottom" {...{ tooltipMsg }}>
@@ -62,4 +62,4 @@ const Coherency: React.FC = () => {
6262
);
6363
};
6464

65-
export default Coherency;
65+
export default Coherence;

web/src/pages/Dashboard/JurorInfo/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useUserQuery } from "queries/useUser";
1212
import { landscapeStyle } from "styles/landscapeStyle";
1313
import { responsiveSize } from "styles/responsiveSize";
1414

15-
import Coherency from "./Coherency";
15+
import Coherence from "./Coherence";
1616
import Header from "./Header";
1717
import JurorRewards from "./JurorRewards";
1818
import PixelArt from "./PixelArt";
@@ -59,7 +59,7 @@ const JurorInfo: React.FC = () => {
5959
/>
6060
<Card>
6161
<PixelArt level={userLevelData.level} width="189px" height="189px" />
62-
<Coherency userLevelData={userLevelData} isMiniGuide={false} {...{ totalCoherentVotes, totalResolvedVotes }} />
62+
<Coherence userLevelData={userLevelData} isMiniGuide={false} {...{ totalCoherentVotes, totalResolvedVotes }} />
6363
<JurorRewards />
6464
</Card>
6565
</Container>

web/src/pages/Home/TopJurors/Header/Coherency.tsx web/src/pages/Home/TopJurors/Header/Coherence.tsx

+7-8
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ const Container = styled.div`
1111
display: flex;
1212
font-size: 12px !important;
1313
&::before {
14-
content: "Coherency";
14+
content: "Coherence";
1515
}
1616
color: ${({ theme }) => theme.secondaryText};
1717
align-items: center;
1818
1919
${landscapeStyle(
20-
() =>
21-
css`
22-
font-size: 14px !important;
23-
justify-content: center;
24-
`
20+
() => css`
21+
font-size: 14px !important;
22+
justify-content: center;
23+
`
2524
)}
2625
`;
2726

@@ -32,7 +31,7 @@ const coherentVotesTooltipMsg =
3231
"voted coherently and the number in the right is the total number of times " +
3332
"the juror voted";
3433

35-
const Coherency: React.FC = () => {
34+
const Coherence: React.FC = () => {
3635
const { width } = useWindowSize();
3736
return (
3837
<Container>
@@ -43,4 +42,4 @@ const Coherency: React.FC = () => {
4342
</Container>
4443
);
4544
};
46-
export default Coherency;
45+
export default Coherence;

web/src/pages/Home/TopJurors/Header/DesktopHeader.tsx

+10-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { responsiveSize } from "styles/responsiveSize";
99
import HowItWorks from "components/HowItWorks";
1010
import JurorLevels from "components/Popup/MiniGuides/JurorLevels";
1111

12-
import Coherency from "./Coherency";
12+
import Coherence from "./Coherence";
1313
import Rewards from "./Rewards";
1414

1515
const Container = styled.div`
@@ -23,15 +23,14 @@ const Container = styled.div`
2323
padding: 18.6px 32px;
2424
2525
${landscapeStyle(
26-
() =>
27-
css`
28-
display: grid;
29-
grid-template-columns:
30-
min-content repeat(3, ${responsiveSize(160, 180, 900)})
31-
auto;
32-
column-gap: ${responsiveSize(12, 28, 900)};
33-
align-items: center;
34-
`
26+
() => css`
27+
display: grid;
28+
grid-template-columns:
29+
min-content repeat(3, ${responsiveSize(160, 180, 900)})
30+
auto;
31+
column-gap: ${responsiveSize(12, 28, 900)};
32+
align-items: center;
33+
`
3534
)}
3635
`;
3736

@@ -52,7 +51,7 @@ export const DesktopHeader: React.FC = () => {
5251
<StyledLabel>#</StyledLabel>
5352
<StyledLabel>Juror</StyledLabel>
5453
<Rewards />
55-
<Coherency />
54+
<Coherence />
5655
<HowItWorksContainer>
5756
<HowItWorks
5857
isMiniGuideOpen={isJurorLevelsMiniGuideOpen}

web/src/pages/Home/TopJurors/JurorCard/Coherency.tsx web/src/pages/Home/TopJurors/JurorCard/Coherence.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ const Container = styled.div`
1111
justify-content: center;
1212
`;
1313

14-
interface ICoherency {
14+
interface ICoherence {
1515
totalCoherentVotes: number;
1616
totalResolvedVotes: number;
1717
}
1818

19-
const Coherency: React.FC<ICoherency> = ({ totalCoherentVotes, totalResolvedVotes }) => {
19+
const Coherence: React.FC<ICoherence> = ({ totalCoherentVotes, totalResolvedVotes }) => {
2020
const coherenceRatio = `${totalCoherentVotes}/${totalResolvedVotes}`;
2121

2222
return (
@@ -28,4 +28,4 @@ const Coherency: React.FC<ICoherency> = ({ totalCoherentVotes, totalResolvedVote
2828

2929
const getPercent = (num: number, den: number): string => `${Math.floor((num * 100) / den)}%`;
3030

31-
export default Coherency;
31+
export default Coherence;

web/src/pages/Home/TopJurors/JurorCard/DesktopCard.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styled, { css } from "styled-components";
44
import { landscapeStyle } from "styles/landscapeStyle";
55
import { responsiveSize } from "styles/responsiveSize";
66

7-
import Coherency from "./Coherency";
7+
import Coherence from "./Coherence";
88
import JurorLevel from "./JurorLevel";
99
import JurorTitle from "./JurorTitle";
1010
import Rank from "./Rank";
@@ -52,7 +52,7 @@ const DesktopCard: React.FC<IDesktopCard> = ({
5252
<Rank rank={rank} />
5353
<JurorTitle address={address} />
5454
<Rewards address={address} />
55-
<Coherency {...{ totalCoherentVotes, totalResolvedVotes }} />
55+
<Coherence {...{ totalCoherentVotes, totalResolvedVotes }} />
5656
<JurorLevel {...{ coherenceScore, totalResolvedDisputes }} />
5757
</Container>
5858
);

web/src/pages/Home/TopJurors/JurorCard/MobileCard.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import styled, { css } from "styled-components";
33

44
import { landscapeStyle } from "styles/landscapeStyle";
55

6-
import HeaderCoherency from "../Header/Coherency";
6+
import HeaderCoherence from "../Header/Coherence";
77
import HeaderRewards from "../Header/Rewards";
88

9-
import Coherency from "./Coherency";
9+
import Coherence from "./Coherence";
1010
import JurorLevel from "./JurorLevel";
1111
import JurorTitle from "./JurorTitle";
1212
import Rank from "./Rank";
@@ -60,7 +60,7 @@ const BottomSide = styled.div`
6060
justify-content: space-between;
6161
`;
6262

63-
const HeaderCoherencyAndCoherency = styled.div`
63+
const HeaderCoherenceAndCoherence = styled.div`
6464
display: flex;
6565
flex-direction: column;
6666
align-items: flex-end;
@@ -102,10 +102,10 @@ const MobileCard: React.FC<IMobileCard> = ({
102102
<HeaderRewards />
103103
<Rewards address={address} />
104104
</HeaderRewardsAndRewards>
105-
<HeaderCoherencyAndCoherency>
106-
<HeaderCoherency />
107-
<Coherency {...{ totalCoherentVotes, totalResolvedVotes }} />
108-
</HeaderCoherencyAndCoherency>
105+
<HeaderCoherenceAndCoherence>
106+
<HeaderCoherence />
107+
<Coherence {...{ totalCoherentVotes, totalResolvedVotes }} />
108+
</HeaderCoherenceAndCoherence>
109109
</BottomSide>
110110
</Container>
111111
);

web/src/utils/userLevelCalculation.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const levelCriteria: ILevelCriteria[] = [
1414
{ level: 4, title: "Aristotle", minDisputes: 10, minScore: 91, maxScore: 100 },
1515
];
1616

17-
export const getUserLevelData = (coherencyScore: number, totalResolvedDisputes: number) => {
17+
export const getUserLevelData = (coherenceScore: number, totalResolvedDisputes: number) => {
1818
for (const criteria of levelCriteria) {
1919
if (
2020
totalResolvedDisputes >= criteria.minDisputes &&
21-
coherencyScore >= criteria.minScore &&
22-
coherencyScore <= criteria.maxScore
21+
coherenceScore >= criteria.minScore &&
22+
coherenceScore <= criteria.maxScore
2323
) {
2424
return levelCriteria.find(({ level }) => level === criteria.level);
2525
}

0 commit comments

Comments
 (0)