Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,084 changes: 790 additions & 294 deletions govtool/frontend/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.2.3",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "0.6.3",
"@intersect.mbo/pdf-ui": "0.6.4",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand All @@ -41,7 +41,7 @@
"blakejs": "^1.2.1",
"buffer": "^6.0.3",
"date-fns": "^2.30.0",
"esbuild": "^0.24.0",
"esbuild": "^0.25.0",
"i18next": "^23.7.19",
"jsonld": "^8.3.2",
"katex": "^0.16.21",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { useNavigate } from "react-router-dom";
import { Trans } from "react-i18next";
import { Box, Chip } from "@mui/material";
import { Box } from "@mui/material";

import { Button } from "@atoms";
import { ICONS, PATHS } from "@consts";
import { useCardano } from "@context";
import {
useGetAdaHolderVotingPowerQuery,
useScreenDimension,
useTranslation,
} from "@hooks";
import { useScreenDimension, useTranslation } from "@hooks";
import { DataMissingHeader } from "@molecules";
import { correctVoteAdaFormat } from "@utils";
import { DRepData } from "@/models";

type DRepDetailsProps = {
Expand All @@ -25,12 +18,9 @@ export const DRepDetailsCardHeader = ({
isMe,
isMyDrep,
}: DRepDetailsProps) => {
const { stakeKey } = useCardano();
const { t } = useTranslation();
const navigate = useNavigate();
const { screenWidth } = useScreenDimension();
const { votingPower: myVotingPower } =
useGetAdaHolderVotingPowerQuery(stakeKey);

const { givenName, metadataStatus, image } = dRepData;

Expand All @@ -48,45 +38,14 @@ export const DRepDetailsCardHeader = ({
alignSelf: "stretch",
display: "flex",
alignItems: "center",
justifyContent: "space-between",
justifyContent: "flex-end",
mb: "18px",
...(screenWidth <= 1020 && {
flexDirection: "column",
gap: 3,
}),
}}
>
<Chip
color="primary"
label={
<Trans
i18nKey={
isMe
? isMyDrep
? "dRepDirectory.myDelegationToYourself"
: "dRepDirectory.meAsDRep"
: "dRepDirectory.myDRep"
}
values={{
ada: correctVoteAdaFormat(myVotingPower),
}}
/>
}
sx={{
boxShadow: (theme) => theme.shadows[2],
color: (theme) => theme.palette.text.primary,
px: 3,
py: 0.5,
...(isMyDrep &&
!isMe && {
width: "100%",
}),
...(screenWidth <= 1020 && {
width: "100%",
}),
}}
/>

{isMe && (
<Box
sx={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ export const DRepDashboardCard = ({
return {
buttons: wasRegisteredOrNotRegisteredButtons,
description: voter?.givenName ? (
<Trans
i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescriptionWithGivenName"
values={{ givenName: voter?.givenName ?? "DRep" }}
/>
<Trans i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescriptionWithGivenName" />
) : (
<Trans i18nKey="dashboard.cards.drep.notRegisteredWasRegisteredDescription" />
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ export const DirectVoterDashboardCard = ({
},
],
description: (
<Trans
i18nKey="dashboard.cards.directVoter.wasRegisteredDescription"
values={{ votingPower: ada }}
/>
<Trans i18nKey="dashboard.cards.directVoter.wasRegisteredDescription" />
),
transactionId: voter?.soleVoterRetireTxHash,
title: t("dashboard.cards.directVoter.wasDirectVoterTitle"),
Expand All @@ -120,10 +117,7 @@ export const DirectVoterDashboardCard = ({
learnMoreButton,
],
description: (
<Trans
i18nKey="dashboard.cards.directVoter.registerDescription"
values={{ votingPower: ada }}
/>
<Trans i18nKey="dashboard.cards.directVoter.registerDescription" />
),
title: t("dashboard.cards.directVoter.registerTitle"),
};
Expand Down
4 changes: 2 additions & 2 deletions govtool/frontend/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"directVoter": {
"isRegisteredDescription": "Your Voting Power of ₳<strong>{{votingPower}}</strong> can be used to vote.",
"register": "Register",
"registerDescription": "Register to Vote on Governance Actions using your own Voting Power of ₳<strong>{{votingPower}}</strong>.",
"registerDescription": "Register to Vote on Governance Actions.",
"registerTitle": "Become a Direct Voter",
"reRegister": "Re-register",
"registration": "Direct Voter Registration",
Expand All @@ -99,7 +99,7 @@
"wasDirectVoterTitle": "You Have Retired as a Direct Voter",
"retirement": "Direct Voter Retirement",
"retirementInProgress": "The retirement process is ongoing. This may take several minutes.",
"wasRegisteredDescription": "You cannot vote on Governance Actions using your own Voting Power of ₳<strong>{{votingPower}}</strong> until you re-register.",
"wasRegisteredDescription": "You cannot vote on Governance Actions until you re-register.",
"youAreDirectVoterTitle": "You are a Direct Voter"
},
"delegation": {
Expand Down
10 changes: 1 addition & 9 deletions govtool/frontend/src/pages/RegisterAsDirectVoter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,12 @@ import {
useWalletErrorModal,
} from "@hooks";
import { CenteredBoxBottomButtons, CenteredBoxPageWrapper } from "@molecules";
import {
PROTOCOL_PARAMS_KEY,
checkIsWalletConnected,
correctVoteAdaFormat,
getItemFromLocalStorage,
openInNewTab,
} from "@utils";
import { checkIsWalletConnected, openInNewTab } from "@utils";
import { WrongRouteInfo } from "@organisms";
import { CertificatesBuilder } from "@emurgo/cardano-serialization-lib-asmjs";

export const RegisterAsDirectVoter = () => {
const { cExplorerBaseUrl } = useAppContext();
const epochParams = getItemFromLocalStorage(PROTOCOL_PARAMS_KEY);
const navigate = useNavigate();
const [isLoading, setIsLoading] = useState(false);
const { t } = useTranslation();
Expand Down Expand Up @@ -144,7 +137,6 @@ export const RegisterAsDirectVoter = () => {
>
<Trans
i18nKey="directVoter.registerDescription"
values={{ deposit: correctVoteAdaFormat(epochParams?.drep_deposit) }}
components={[
<Link
onClick={() =>
Expand Down
8 changes: 4 additions & 4 deletions govtool/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1504,10 +1504,10 @@
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.1.0.tgz"
integrity sha512-sjKEtnK9eLYH/8kCD0YRQCms3byFA/tnSsei9NHTZbBYX9sBpeX6ErfR0sKYjOSxQOxl4FumX9D0X+vHIqxo8g==

"@intersect.mbo/pdf-ui@0.6.3":
version "0.6.3"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.6.3.tgz"
integrity sha512-oyqogADhBjZl9JFK8bCMF/V/ImCMW8AiZeBv+6Ofb/tZ+thopAQEv/y+YZdCUmCAiBp3/g4c3eRJK9WVYcG3Fg==
"@intersect.mbo/pdf-ui@0.6.4":
version "0.6.4"
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.6.4.tgz"
integrity sha512-KWnbwn9VQwTuQ+POFX6VtA+e7zmotq/kBJmfXux5i2XPQz9PB1Ia/L6mPPr82Gf0x0R2MSU1nZLsSeSl6QE64A==
dependencies:
"@emurgo/cardano-serialization-lib-asmjs" "^12.0.0-beta.2"
"@fontsource/poppins" "^5.0.14"
Expand Down