Skip to content

Commit c9a9eee

Browse files
authored
Merge pull request #3087 from IntersectMBO/develop
GovTool - v2.0.13-candidate
2 parents dc9f16b + f69d253 commit c9a9eee

File tree

8 files changed

+805
-367
lines changed

8 files changed

+805
-367
lines changed

govtool/frontend/package-lock.json

Lines changed: 790 additions & 294 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@hookform/resolvers": "^3.3.1",
3030
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.2.3",
3131
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
32-
"@intersect.mbo/pdf-ui": "0.6.3",
32+
"@intersect.mbo/pdf-ui": "0.6.4",
3333
"@mui/icons-material": "^5.14.3",
3434
"@mui/material": "^5.14.4",
3535
"@rollup/plugin-babel": "^6.0.4",
@@ -41,7 +41,7 @@
4141
"blakejs": "^1.2.1",
4242
"buffer": "^6.0.3",
4343
"date-fns": "^2.30.0",
44-
"esbuild": "^0.24.0",
44+
"esbuild": "^0.25.0",
4545
"i18next": "^23.7.19",
4646
"jsonld": "^8.3.2",
4747
"katex": "^0.16.21",

govtool/frontend/src/components/organisms/DRepDetailsCardHeader.tsx

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
import { useNavigate } from "react-router-dom";
2-
import { Trans } from "react-i18next";
3-
import { Box, Chip } from "@mui/material";
2+
import { Box } from "@mui/material";
43

54
import { Button } from "@atoms";
65
import { ICONS, PATHS } from "@consts";
7-
import { useCardano } from "@context";
8-
import {
9-
useGetAdaHolderVotingPowerQuery,
10-
useScreenDimension,
11-
useTranslation,
12-
} from "@hooks";
6+
import { useScreenDimension, useTranslation } from "@hooks";
137
import { DataMissingHeader } from "@molecules";
14-
import { correctVoteAdaFormat } from "@utils";
158
import { DRepData } from "@/models";
169

1710
type DRepDetailsProps = {
@@ -25,12 +18,9 @@ export const DRepDetailsCardHeader = ({
2518
isMe,
2619
isMyDrep,
2720
}: DRepDetailsProps) => {
28-
const { stakeKey } = useCardano();
2921
const { t } = useTranslation();
3022
const navigate = useNavigate();
3123
const { screenWidth } = useScreenDimension();
32-
const { votingPower: myVotingPower } =
33-
useGetAdaHolderVotingPowerQuery(stakeKey);
3424

3525
const { givenName, metadataStatus, image } = dRepData;
3626

@@ -48,45 +38,14 @@ export const DRepDetailsCardHeader = ({
4838
alignSelf: "stretch",
4939
display: "flex",
5040
alignItems: "center",
51-
justifyContent: "space-between",
41+
justifyContent: "flex-end",
5242
mb: "18px",
5343
...(screenWidth <= 1020 && {
5444
flexDirection: "column",
5545
gap: 3,
5646
}),
5747
}}
5848
>
59-
<Chip
60-
color="primary"
61-
label={
62-
<Trans
63-
i18nKey={
64-
isMe
65-
? isMyDrep
66-
? "dRepDirectory.myDelegationToYourself"
67-
: "dRepDirectory.meAsDRep"
68-
: "dRepDirectory.myDRep"
69-
}
70-
values={{
71-
ada: correctVoteAdaFormat(myVotingPower),
72-
}}
73-
/>
74-
}
75-
sx={{
76-
boxShadow: (theme) => theme.shadows[2],
77-
color: (theme) => theme.palette.text.primary,
78-
px: 3,
79-
py: 0.5,
80-
...(isMyDrep &&
81-
!isMe && {
82-
width: "100%",
83-
}),
84-
...(screenWidth <= 1020 && {
85-
width: "100%",
86-
}),
87-
}}
88-
/>
89-
9049
{isMe && (
9150
<Box
9251
sx={{

govtool/frontend/src/components/organisms/DashboardCards/DRepDashboardCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ export const DRepDashboardCard = ({
138138
return {
139139
buttons: wasRegisteredOrNotRegisteredButtons,
140140
description: voter?.givenName ? (
141-
<Trans
142-
i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescriptionWithGivenName"
143-
values={{ givenName: voter?.givenName ?? "DRep" }}
144-
/>
141+
<Trans i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescriptionWithGivenName" />
145142
) : (
146143
<Trans i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescription" />
147144
),

govtool/frontend/src/components/organisms/DashboardCards/DirectVoterDashboardCard.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,7 @@ export const DirectVoterDashboardCard = ({
9898
},
9999
],
100100
description: (
101-
<Trans
102-
i18nKey="dashboard.cards.directVoter.wasRegisteredDescription"
103-
values={{ votingPower: ada }}
104-
/>
101+
<Trans i18nKey="dashboard.cards.directVoter.wasRegisteredDescription" />
105102
),
106103
transactionId: voter?.soleVoterRetireTxHash,
107104
title: t("dashboard.cards.directVoter.wasDirectVoterTitle"),
@@ -120,10 +117,7 @@ export const DirectVoterDashboardCard = ({
120117
learnMoreButton,
121118
],
122119
description: (
123-
<Trans
124-
i18nKey="dashboard.cards.directVoter.registerDescription"
125-
values={{ votingPower: ada }}
126-
/>
120+
<Trans i18nKey="dashboard.cards.directVoter.registerDescription" />
127121
),
128122
title: t("dashboard.cards.directVoter.registerTitle"),
129123
};

govtool/frontend/src/i18n/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"directVoter": {
9191
"isRegisteredDescription": "Your Voting Power of ₳<strong>{{votingPower}}</strong> can be used to vote.",
9292
"register": "Register",
93-
"registerDescription": "Register to Vote on Governance Actions using your own Voting Power of ₳<strong>{{votingPower}}</strong>.",
93+
"registerDescription": "Register to Vote on Governance Actions.",
9494
"registerTitle": "Become a Direct Voter",
9595
"reRegister": "Re-register",
9696
"registration": "Direct Voter Registration",
@@ -99,7 +99,7 @@
9999
"wasDirectVoterTitle": "You Have Retired as a Direct Voter",
100100
"retirement": "Direct Voter Retirement",
101101
"retirementInProgress": "The retirement process is ongoing. This may take several minutes.",
102-
"wasRegisteredDescription": "You cannot vote on Governance Actions using your own Voting Power of ₳<strong>{{votingPower}}</strong> until you re-register.",
102+
"wasRegisteredDescription": "You cannot vote on Governance Actions until you re-register.",
103103
"youAreDirectVoterTitle": "You are a Direct Voter"
104104
},
105105
"delegation": {

govtool/frontend/src/pages/RegisterAsDirectVoter.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,12 @@ import {
1313
useWalletErrorModal,
1414
} from "@hooks";
1515
import { CenteredBoxBottomButtons, CenteredBoxPageWrapper } from "@molecules";
16-
import {
17-
PROTOCOL_PARAMS_KEY,
18-
checkIsWalletConnected,
19-
correctVoteAdaFormat,
20-
getItemFromLocalStorage,
21-
openInNewTab,
22-
} from "@utils";
16+
import { checkIsWalletConnected, openInNewTab } from "@utils";
2317
import { WrongRouteInfo } from "@organisms";
2418
import { CertificatesBuilder } from "@emurgo/cardano-serialization-lib-asmjs";
2519

2620
export const RegisterAsDirectVoter = () => {
2721
const { cExplorerBaseUrl } = useAppContext();
28-
const epochParams = getItemFromLocalStorage(PROTOCOL_PARAMS_KEY);
2922
const navigate = useNavigate();
3023
const [isLoading, setIsLoading] = useState(false);
3124
const { t } = useTranslation();
@@ -144,7 +137,6 @@ export const RegisterAsDirectVoter = () => {
144137
>
145138
<Trans
146139
i18nKey="directVoter.registerDescription"
147-
values={{ deposit: correctVoteAdaFormat(epochParams?.drep_deposit) }}
148140
components={[
149141
<Link
150142
onClick={() =>

govtool/frontend/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,10 +1504,10 @@
15041504
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.1.0.tgz"
15051505
integrity sha512-sjKEtnK9eLYH/8kCD0YRQCms3byFA/tnSsei9NHTZbBYX9sBpeX6ErfR0sKYjOSxQOxl4FumX9D0X+vHIqxo8g==
15061506

1507-
"@intersect.mbo/[email protected].3":
1508-
version "0.6.3"
1509-
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.6.3.tgz"
1510-
integrity sha512-oyqogADhBjZl9JFK8bCMF/V/ImCMW8AiZeBv+6Ofb/tZ+thopAQEv/y+YZdCUmCAiBp3/g4c3eRJK9WVYcG3Fg==
1507+
"@intersect.mbo/[email protected].4":
1508+
version "0.6.4"
1509+
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.6.4.tgz"
1510+
integrity sha512-KWnbwn9VQwTuQ+POFX6VtA+e7zmotq/kBJmfXux5i2XPQz9PB1Ia/L6mPPr82Gf0x0R2MSU1nZLsSeSl6QE64A==
15111511
dependencies:
15121512
"@emurgo/cardano-serialization-lib-asmjs" "^12.0.0-beta.2"
15131513
"@fontsource/poppins" "^5.0.14"

0 commit comments

Comments
 (0)