From 3be50b1d4d2f0db101c14b4458d775306ed340e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Sworze=C5=84?= Date: Wed, 3 Apr 2024 17:39:06 +0200 Subject: [PATCH 1/2] [#578] new cards UI --- govtool/frontend/index.html | 3 + .../src/components/molecules/CopyableInfo.tsx | 20 +-- .../molecules/DashboardActionCard.tsx | 39 ++++-- .../components/molecules/SoleVoterAction.tsx | 55 ++++++++ .../src/components/molecules/index.ts | 5 +- .../src/components/molecules/types.ts | 6 + .../components/organisms/DashboardCards.tsx | 9 +- .../DashboardCards/DRepDashboardCard.tsx | 92 +++++++------ .../ListGovActionsDashboardCard.tsx | 25 ++-- .../ProposeGovActionDashboardCard.tsx | 26 ++-- .../DashboardCards/SoleVoterDashboardCard.tsx | 109 ++++++++++----- .../organisms/RetireAsSoleVoterBoxContent.tsx | 3 +- govtool/frontend/src/context/index.ts | 1 + .../src/hooks/queries/useGetProposalsQuery.ts | 12 +- govtool/frontend/src/i18n/locales/en.ts | 125 ++++++++++-------- govtool/frontend/src/pages/RegisterAsdRep.tsx | 5 +- 16 files changed, 351 insertions(+), 184 deletions(-) create mode 100644 govtool/frontend/src/components/molecules/SoleVoterAction.tsx diff --git a/govtool/frontend/index.html b/govtool/frontend/index.html index ac87ebc7a..9fa7c8404 100644 --- a/govtool/frontend/index.html +++ b/govtool/frontend/index.html @@ -18,6 +18,9 @@ overscroll-behavior-y: none; padding: 0; } + #root { + white-space: pre-line; + } diff --git a/govtool/frontend/src/components/molecules/CopyableInfo.tsx b/govtool/frontend/src/components/molecules/CopyableInfo.tsx index 60597f572..792aabc72 100644 --- a/govtool/frontend/src/components/molecules/CopyableInfo.tsx +++ b/govtool/frontend/src/components/molecules/CopyableInfo.tsx @@ -1,19 +1,22 @@ -import { Box, Typography } from "@mui/material"; +import { Box, SxProps, Typography } from "@mui/material"; import { CopyButton } from "@atoms"; +import { gray } from "@consts"; + import { Card } from "./Card"; -import { gray } from "@/consts"; type CopyableInfoProps = { dataTestId?: string; label: string; value: string; + sx?: SxProps; }; export const CopyableInfo = ({ dataTestId, label, value, + sx, }: CopyableInfoProps) => ( theme.palette.neutralWhite, + ...sx, }} > + + {label} + - - {label} - - - - {value} + ); diff --git a/govtool/frontend/src/components/molecules/DashboardActionCard.tsx b/govtool/frontend/src/components/molecules/DashboardActionCard.tsx index 55dde49ad..feb9f39fb 100644 --- a/govtool/frontend/src/components/molecules/DashboardActionCard.tsx +++ b/govtool/frontend/src/components/molecules/DashboardActionCard.tsx @@ -1,9 +1,10 @@ import { Box, Skeleton } from "@mui/material"; import { FC, ReactNode } from "react"; -import { LoadingButton, LoadingButtonProps, Typography } from "@atoms"; +import { Button, LoadingButton, LoadingButtonProps, Typography } from "@atoms"; import { useScreenDimension, useTranslation } from "@hooks"; import { Card } from "./Card"; +import { openInNewTab } from "@/utils"; export type DashboardActionCardProps = { buttons?: LoadingButtonProps[]; @@ -12,8 +13,10 @@ export type DashboardActionCardProps = { description?: ReactNode; imageURL?: string; isLoading?: boolean; + isInProgressOnCard?: boolean; state?: "active" | "inProgress" | "default"; title?: ReactNode; + transactionId?: string; }; export const DashboardActionCard: FC = ({ @@ -26,12 +29,17 @@ export const DashboardActionCard: FC = ({ description, imageURL, isLoading = false, + isInProgressOnCard = true, state = "default", title, + transactionId, } = props; const { screenWidth } = useScreenDimension(); + const onClickShowTransaction = () => + openInNewTab(`https://sancho.cexplorer.io/tx/${transactionId}`); + return ( = ({ variant: "warning", })} sx={{ + backgroundColor: state === "active" ? "#F0F4FF" : undefined, flex: 1, display: "flex", flexDirection: "column", - gap: 3, maxWidth: 524, }} > @@ -69,11 +77,15 @@ export const DashboardActionCard: FC = ({ {title ? ( {isLoading ? : title} - - ) : null} - {state === "inProgress" && !isLoading ? ( - - {t("inProgress")} + {state === "inProgress" && !isLoading && isInProgressOnCard ? ( + + {` ${t("inProgress")}`} + + ) : null} ) : null} {description ? ( @@ -93,10 +105,20 @@ export const DashboardActionCard: FC = ({ ) : null} {children} + {transactionId && ( + + )} {isLoading ? ( <> @@ -125,6 +147,7 @@ export const DashboardActionCard: FC = ({ xxs: "100%", md: "auto", }, + ...buttonProps.sx, }} {...buttonProps} /> diff --git a/govtool/frontend/src/components/molecules/SoleVoterAction.tsx b/govtool/frontend/src/components/molecules/SoleVoterAction.tsx new file mode 100644 index 000000000..c58e60485 --- /dev/null +++ b/govtool/frontend/src/components/molecules/SoleVoterAction.tsx @@ -0,0 +1,55 @@ +import { Box } from "@mui/material"; +import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; + +import { Typography } from "@atoms"; +import { gray } from "@consts"; +import { useTranslation } from "@hooks"; + +import { Card } from "./Card"; +import { SoleVoterActionProps } from "./types"; + +export const SoleVoterAction = ({ + dRepId, + onClickArrow, + sx, +}: SoleVoterActionProps) => { + const { t } = useTranslation(); + + return ( + theme.palette.neutralWhite, + borderColor: gray.c100, + display: "flex", + justifyContent: "space-between", + px: 1.5, + py: 1, + ...sx, + }} + > + + + {t("dashboard.cards.drepName")} + + + {dRepId} + + + + + ); +}; diff --git a/govtool/frontend/src/components/molecules/index.ts b/govtool/frontend/src/components/molecules/index.ts index ccd16ba85..419010f63 100644 --- a/govtool/frontend/src/components/molecules/index.ts +++ b/govtool/frontend/src/components/molecules/index.ts @@ -15,12 +15,12 @@ export * from "./GovActionDetails"; export * from "./GovernanceActionCard"; export * from "./GovernanceActionCardElement"; export * from "./GovernanceActionCardHeader"; -export * from "./GovernanceActionDetailsCardLinks"; export * from "./GovernanceActionCardMyVote"; export * from "./GovernanceActionCardStatePill"; -export * from "./GovernanceActionDetailsCardVotes"; export * from "./GovernanceActionDetailsCardHeader"; +export * from "./GovernanceActionDetailsCardLinks"; export * from "./GovernanceActionDetailsCardOnChainData"; +export * from "./GovernanceActionDetailsCardVotes"; export * from "./GovernanceActionsDatesBox"; export * from "./GovernanceVotedOnCard"; export * from "./LinkWithIcon"; @@ -28,6 +28,7 @@ export * from "./OrderActionsChip"; export * from "./Share"; export * from "./SliderArrow"; export * from "./SliderArrows"; +export * from "./SoleVoterAction"; export * from "./Step"; export * from "./VoteActionForm"; export * from "./VotesSubmitted"; diff --git a/govtool/frontend/src/components/molecules/types.ts b/govtool/frontend/src/components/molecules/types.ts index dbe0db33c..88f349091 100644 --- a/govtool/frontend/src/components/molecules/types.ts +++ b/govtool/frontend/src/components/molecules/types.ts @@ -15,3 +15,9 @@ export type StepProps = { componentsLayoutStyles?: SxProps; layoutStyles?: SxProps; }; + +export type SoleVoterActionProps = { + dRepId: string; + onClickArrow: () => void; + sx?: SxProps; +}; diff --git a/govtool/frontend/src/components/organisms/DashboardCards.tsx b/govtool/frontend/src/components/organisms/DashboardCards.tsx index f64929d3b..300e7502c 100644 --- a/govtool/frontend/src/components/organisms/DashboardCards.tsx +++ b/govtool/frontend/src/components/organisms/DashboardCards.tsx @@ -22,9 +22,9 @@ export const DashboardCards = () => { const { voter } = useGetVoterInfo(); if ( - currentDelegation === undefined - || votingPower === undefined - || voter === undefined + currentDelegation === undefined || + votingPower === undefined || + voter === undefined ) { return ( { /> - + + openInNewTab( + "https://docs.sanchogov.tools/faqs/what-does-it-mean-to-register-as-a-drep", + ), + }; + const cardProps: Partial = (() => { // transaction in progress if (inProgress) { return { - buttons: [ - { - children: t("seeTransaction"), - onClick: () => - openInNewTab("https://adanordic.com/latest_transactions"), - }, - ], + buttons: [learnMoreButton], state: "inProgress", ...(pendingTransaction.registerAsDrep && { - description: t("dashboard.registration.registrationInProgress"), - title: t("dashboard.registration.dRepRegistration"), + description: t("dashboard.cards.drep.registrationInProgress"), + title: t("dashboard.cards.drep.dRepRegistration"), }), ...(pendingTransaction.retireAsDrep && { - description: t("dashboard.registration.retirementInProgress"), - title: t("dashboard.registration.dRepRetirement"), + description: ( + + ), + title: t("dashboard.cards.drep.dRepRetirement"), }), ...(pendingTransaction.updateMetaData && { - description: t("dashboard.registration.metadataUpdateInProgress"), - title: t("dashboard.registration.dRepUpdate"), + description: t("dashboard.cards.drep.metadataUpdateInProgress"), + title: t("dashboard.cards.drep.dRepUpdate"), }), }; } @@ -63,20 +72,23 @@ export const DRepDashboardCard = ({ return { buttons: [ { - children: t("dashboard.registration.retire"), - dataTestId: "retire-button", - onClick: () => navigate(PATHS.retireAsDrep), + children: t("dashboard.cards.drep.viewDetails"), + dataTestId: "view-drep-details-button", + // TODO: change navigation to drep explorer + onClick: () => navigate("/"), + variant: "outlined", + sx: { backgroundColor: "arcticWhite" }, }, { - children: t("dashboard.registration.changeMetadata"), - dataTestId: "change-metadata-button", - onClick: () => navigate(PATHS.editDrepMetadata), + children: t("dashboard.cards.drep.retire"), + dataTestId: "retire-button", + onClick: () => navigate(PATHS.retireAsDrep), variant: "text", }, ], - description: t("dashboard.registration.holdersCanDelegate"), + description: t("dashboard.cards.drep.registeredDescription"), state: "active", - title: t("dashboard.registration.youAreRegistered"), + title: t("dashboard.cards.drep.registeredTitle"), }; } @@ -86,49 +98,49 @@ export const DRepDashboardCard = ({ { children: t( voter.wasRegisteredAsDRep - ? "dashboard.registration.reRegister" - : "dashboard.registration.register", + ? "dashboard.cards.drep.reRegister" + : "dashboard.cards.drep.register", ), dataTestId: "register-button", onClick: () => navigate(PATHS.registerAsdRep), variant: "contained", }, - { - children: t("learnMore"), - dataTestId: "register-learn-more-button", - onClick: () => - openInNewTab( - "https://docs.sanchogov.tools/faqs/what-does-it-mean-to-register-as-a-drep", - ), - }, + learnMoreButton, ]; // was registered if (voter?.wasRegisteredAsDRep) { return { buttons: wasRegisteredOrNotRegisteredButtons, - description: t("dashboard.registration.holdersCanDelegate"), - title: t("dashboard.registration.registerAgain"), + description: ( + + ), + title: t("dashboard.cards.drep.notRegisteredWasRegisteredTitle"), }; } // not registered return { buttons: wasRegisteredOrNotRegisteredButtons, - description: t("dashboard.registration.ifYouWant"), - title: t("dashboard.registration.registerAsDRep"), + description: t("dashboard.cards.drep.notRegisteredDescription"), + title: t("dashboard.cards.drep.notRegisteredTitle"), }; })(); return ( - {(voter?.isRegisteredAsDRep || voter?.wasRegisteredAsDRep) && ( + {voter?.isRegisteredAsDRep && !pendingTransaction?.retireAsDrep && ( )} diff --git a/govtool/frontend/src/components/organisms/DashboardCards/ListGovActionsDashboardCard.tsx b/govtool/frontend/src/components/organisms/DashboardCards/ListGovActionsDashboardCard.tsx index dfc42cc36..a32209292 100644 --- a/govtool/frontend/src/components/organisms/DashboardCards/ListGovActionsDashboardCard.tsx +++ b/govtool/frontend/src/components/organisms/DashboardCards/ListGovActionsDashboardCard.tsx @@ -3,13 +3,9 @@ import { useNavigate } from "react-router-dom"; import { IMAGES, PATHS } from "@consts"; import { useTranslation } from "@hooks"; import { DashboardActionCard } from "@molecules"; -import { VoterInfo } from "@/models"; +import { openInNewTab } from "@utils"; -type ListGovActionsDashboardCardsProps = { - voter: VoterInfo; -}; - -export const ListGovActionsDashboardCards = ({ voter }: ListGovActionsDashboardCardsProps) => { +export const ListGovActionsDashboardCards = () => { const navigate = useNavigate(); const { t } = useTranslation(); @@ -17,18 +13,21 @@ export const ListGovActionsDashboardCards = ({ voter }: ListGovActionsDashboardC navigate(PATHS.dashboardGovernanceActions), + variant: "contained", + }, + { + children: t("learnMore"), + dataTestId: "learn-more-governance-actions-button", + onClick: () => openInNewTab("https://sancho.network/actions"), + variant: "outlined", }, ]} - description={t("dashboard.govActions.description")} + description={t("dashboard.cards.govActions.description")} imageURL={IMAGES.govActionListImage} - title={t("dashboard.govActions.title")} + title={t("dashboard.cards.govActions.title")} /> ); }; diff --git a/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx b/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx index 6bace3a8d..295e3fc5c 100644 --- a/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx +++ b/govtool/frontend/src/components/organisms/DashboardCards/ProposeGovActionDashboardCard.tsx @@ -1,10 +1,10 @@ import { useNavigate } from "react-router-dom"; import { IMAGES, PATHS } from "@consts"; +import { PendingTransaction } from "@context"; import { useTranslation } from "@hooks"; import { DashboardActionCard } from "@molecules"; import { openInNewTab } from "@utils"; -import { PendingTransaction } from "@/context/pendingTransaction"; type ProposeGovActionDashboardCardProps = { createGovActionTx: PendingTransaction["createGovAction"]; @@ -20,38 +20,40 @@ export const ProposeGovActionDashboardCard = ({ navigate(PATHS.dashboardGovernanceActions), variant: "contained", } as const, - ] - // default - : [ + ] + : // default + [ { - children: t("dashboard.proposeGovernanceAction.propose"), + children: t("dashboard.cards.proposeGovernanceAction.propose"), dataTestId: "propose-governance-actions-button", onClick: () => navigate(PATHS.createGovernanceAction), variant: "contained", } as const, - ]), + ]), // common { children: t("learnMore"), dataTestId: "learn-more-button", onClick: () => openInNewTab( - "https://docs.sanchogov.tools/faqs/what-is-a-governance-action" + "https://docs.sanchogov.tools/faqs/what-is-a-governance-action", ), }, ]} - description={t("dashboard.proposeGovernanceAction.description")} + description={t("dashboard.cards.proposeGovernanceAction.description")} imageURL={IMAGES.proposeGovActionImage} + isInProgressOnCard={false} + transactionId={createGovActionTx?.transactionHash} state={createGovActionTx ? "inProgress" : "default"} - title={t("dashboard.proposeGovernanceAction.title")} + title={t("dashboard.cards.proposeGovernanceAction.title")} /> ); }; diff --git a/govtool/frontend/src/components/organisms/DashboardCards/SoleVoterDashboardCard.tsx b/govtool/frontend/src/components/organisms/DashboardCards/SoleVoterDashboardCard.tsx index 95eb1449b..68be628f1 100644 --- a/govtool/frontend/src/components/organisms/DashboardCards/SoleVoterDashboardCard.tsx +++ b/govtool/frontend/src/components/organisms/DashboardCards/SoleVoterDashboardCard.tsx @@ -2,20 +2,26 @@ import { useNavigate } from "react-router-dom"; import { Trans } from "react-i18next"; import { IMAGES, PATHS } from "@consts"; +import { PendingTransaction } from "@context"; import { useTranslation } from "@hooks"; -import { DashboardActionCard, DashboardActionCardProps } from "@molecules"; +import { + DashboardActionCard, + DashboardActionCardProps, + SoleVoterAction, +} from "@molecules"; import { correctAdaFormat, openInNewTab } from "@utils"; import { LoadingButtonProps } from "@atoms"; -import { PendingTransaction } from "@/context/pendingTransaction"; -import { VoterInfo } from "@/models"; +import { VoterInfo } from "@models"; type SoleVoterDashboardCardProps = { + dRepIDBech32: string; pendingTransaction: PendingTransaction; voter: VoterInfo; votingPower: number; }; export const SoleVoterDashboardCard = ({ + dRepIDBech32, pendingTransaction, voter, votingPower, @@ -25,6 +31,19 @@ export const SoleVoterDashboardCard = ({ const ada = correctAdaFormat(votingPower); + // TODO: Add navigation to DRep explorer + const onClickAction = () => navigate("/"); + + // learn more button + const learnMoreButton: LoadingButtonProps = { + children: t("learnMore"), + dataTestId: "learn-more-button", + onClick: () => + openInNewTab( + "https://docs.sanchogov.tools/faqs/what-does-it-mean-to-register-as-a-drep", + ), + }; + const cardProps: Partial = (() => { // transaction in progress if ( @@ -32,50 +51,40 @@ export const SoleVoterDashboardCard = ({ !!pendingTransaction.retireAsSoleVoter ) { return { - buttons: [ - { - children: t("seeTransaction"), - dataTestId: "see-transaction-button", - onClick: () => - openInNewTab("https://adanordic.com/latest_transactions"), - }, - ], + buttons: [learnMoreButton], state: "inProgress", ...(pendingTransaction.registerAsSoleVoter && { - description: t("dashboard.soleVoter.registrationInProgress"), - title: t("dashboard.soleVoter.registration"), + description: t("dashboard.cards.soleVoter.registrationInProgress"), + title: t("dashboard.cards.soleVoter.registration"), + transactionId: pendingTransaction.registerAsSoleVoter.resourceId, }), ...(pendingTransaction.retireAsSoleVoter && { - description: t("dashboard.soleVoter.retirementInProgress"), - title: t("dashboard.soleVoter.retirement"), + description: t("dashboard.cards.soleVoter.retirementInProgress"), + title: t("dashboard.cards.soleVoter.retirement"), }), }; } - // learn more button - const learnMoreButton: LoadingButtonProps = { - children: t("learnMore"), - dataTestId: "learn-more-button", - onClick: () => - openInNewTab( - "https://docs.sanchogov.tools/faqs/what-does-it-mean-to-register-as-a-drep" - ), - }; - // currently registered if (voter?.isRegisteredAsSoleVoter) { return { buttons: [ { - children: t("dashboard.soleVoter.retire"), + children: t("dashboard.cards.soleVoter.retire"), dataTestId: "retire-as-sole-voter-button", onClick: () => navigate(PATHS.retireAsSoleVoter), + sx: { backgroundColor: "arcticWhite" }, }, - learnMoreButton, + { ...learnMoreButton, variant: "text" }, ], - description: , + description: ( + + ), state: "active", - title: t("dashboard.soleVoter.youAreSoleVoterTitle"), + title: t("dashboard.cards.soleVoter.youAreSoleVoterTitle"), }; } @@ -84,14 +93,20 @@ export const SoleVoterDashboardCard = ({ return { buttons: [ { - children: t("dashboard.soleVoter.reRegister"), + children: t("dashboard.cards.soleVoter.reRegister"), dataTestId: "register-as-sole-voter-button", onClick: () => navigate(PATHS.registerAsSoleVoter), + variant: "contained", }, learnMoreButton, ], - description: , - title: t("dashboard.soleVoter.wasSoleVoterTitle"), + description: ( + + ), + title: t("dashboard.cards.soleVoter.wasSoleVoterTitle"), }; } @@ -99,19 +114,41 @@ export const SoleVoterDashboardCard = ({ return { buttons: [ { - children: t("dashboard.soleVoter.register"), + children: t("dashboard.cards.soleVoter.register"), dataTestId: "register-as-sole-voter-button", onClick: () => navigate(PATHS.registerAsSoleVoter), variant: "contained", }, learnMoreButton, ], - description: , - title: t("dashboard.soleVoter.registerTitle"), + description: ( + + ), + title: t("dashboard.cards.soleVoter.registerTitle"), }; })(); return ( - + + {(pendingTransaction?.registerAsSoleVoter || + voter.isRegisteredAsSoleVoter) && ( + + )} + ); }; diff --git a/govtool/frontend/src/components/organisms/RetireAsSoleVoterBoxContent.tsx b/govtool/frontend/src/components/organisms/RetireAsSoleVoterBoxContent.tsx index 983e0b81d..776b3b724 100644 --- a/govtool/frontend/src/components/organisms/RetireAsSoleVoterBoxContent.tsx +++ b/govtool/frontend/src/components/organisms/RetireAsSoleVoterBoxContent.tsx @@ -22,7 +22,6 @@ export const RetireAsSoleVoterBoxContent = () => { mt: isMobile ? 4 : 10, textAlign: "center", whiteSpace: "pre-line", - textDecoration: "underline", }} variant="body1" > @@ -32,7 +31,7 @@ export const RetireAsSoleVoterBoxContent = () => { components={[ openInNewTab("https://sancho.network/")} - sx={{ cursor: "pointer" }} + sx={{ cursor: "pointer", textDecoration: "none" }} key="0" />, ]} diff --git a/govtool/frontend/src/context/index.ts b/govtool/frontend/src/context/index.ts index fec76656f..4fe6a9c62 100644 --- a/govtool/frontend/src/context/index.ts +++ b/govtool/frontend/src/context/index.ts @@ -1,4 +1,5 @@ export * from "./contextProviders"; export * from "./modal"; +export * from "./pendingTransaction"; export * from "./snackbar"; export * from "./wallet"; diff --git a/govtool/frontend/src/hooks/queries/useGetProposalsQuery.ts b/govtool/frontend/src/hooks/queries/useGetProposalsQuery.ts index 7c707f7f4..2bcb4f3c5 100644 --- a/govtool/frontend/src/hooks/queries/useGetProposalsQuery.ts +++ b/govtool/frontend/src/hooks/queries/useGetProposalsQuery.ts @@ -4,6 +4,7 @@ import { QUERY_KEYS } from "@consts"; import { useCardano } from "@context"; import { getProposals, GetProposalsArguments } from "@services"; import { checkIsMissingGAMetadata } from "@utils"; +import { useGetVoterInfo } from "."; export const useGetProposalsQuery = ({ filters = [], @@ -11,11 +12,20 @@ export const useGetProposalsQuery = ({ sorting, }: GetProposalsArguments) => { const { dRepID, pendingTransaction } = useCardano(); + const { voter } = useGetVoterInfo(); const fetchProposals = async (): Promise => { const allProposals = await Promise.all( filters.map((filter) => - getProposals({ dRepID, filters: [filter], searchPhrase, sorting }), + getProposals({ + dRepID: + voter?.isRegisteredAsDRep || voter?.isRegisteredAsSoleVoter + ? dRepID + : undefined, + filters: [filter], + searchPhrase, + sorting, + }), ), ); diff --git a/govtool/frontend/src/i18n/locales/en.ts b/govtool/frontend/src/i18n/locales/en.ts index af2963504..4ddb5b5df 100644 --- a/govtool/frontend/src/i18n/locales/en.ts +++ b/govtool/frontend/src/i18n/locales/en.ts @@ -52,6 +52,74 @@ export const en = { headingOne: "Your Participation", headingTwo: "See Active Governance Actions", title: "Dashboard", + cards: { + drepName: "Drep_name", + showTransaction: "Show Transaction", + drep: { + changeMetadata: "Change metadata", + dRepRegistration: "DRep Registration", + dRepRetirement: "DRep Retirement", + dRepUpdate: "DRep Update", + holdersCanDelegate: + "Ada holders can delegate their voting power to you.", + ifYouWant: + "If you want to directly participate in voting and have other ada holders delegate their voting power to you.", + metadataUpdateInProgress: + "The update DRep metadata is ongoing. This may take several minutes.", + notRegisteredDescription: + "Accept delegated voting power from other ADA holders, and combine it with your own voting power. Vote with the accumulated Power on Governance Actions.", + notRegisteredTitle: "Become a DRep", + notRegisteredWasRegisteredDescription: + "You are now retired and your listing in the DRep directory as MrDRep has been marked as retired. You cannot vote on Governance Actions as MrDRep.\n\nYou can always re-register as a DRep, in which case you will have the same DRep ID as you had initially.", + notRegisteredWasRegisteredTitle: "You Have Retired as a DRep.", + register: "Register", + registerAgain: "Register Again as a dRep", + registerAsDRep: "Register as a DRep", + registeredDescription: + "You can Vote using your own Voting Power combined with any Voting Power delegated to you.", + registeredTitle: "You are Registered as a DRep", + registrationInProgress: + "The registration process is ongoing. This may take several minutes.", + reRegister: "Re-register as a DRep", + retire: "Retire as a DRep", + retirementInProgress: + "You are being retired as MrDRep. You will receive a refund of {{deposit}} ADA when the transaction completes.", + viewDetails: "View your DRep details", + youAreRegistered: "You are Registered as a DRep", + yourDRepId: "Your DRep ID", + }, + govActions: { + description: "Review governance actions submitted on-chain.", + reviewAndVote: "Review and vote", + title: "View Governance Actions", + }, + proposeGovernanceAction: { + title: "Propose a Governance Action", + description: "Submit your proposal for a Governance Action.", + propose: "Propose", + view: "View Governance Actions", + }, + soleVoter: { + isRegisteredDescription: + "Your Voting Power of ₳{{votingPower}} can be used to vote.", + register: "Register", + registerDescription: + "Vote on Governance Actions using your own voting power of ₳{{votingPower}}.", + registerTitle: "Become a Sole Voter", + reRegister: "Re-register", + registration: "Sole Voter Registration", + registrationInProgress: + "The registration process is ongoing. This may take several minutes.", + retire: "Retire", + wasSoleVoterTitle: "You Have Retired as a Sole Voter", + retirement: "Sole 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 ₳{{votingPower}}. until you re-register.", + youAreSoleVoterTitle: "You are a Sole Voter", + }, + }, delegation: { changeDelegation: "Change delegation", delegateOwnPower: @@ -80,60 +148,6 @@ export const en = { "Your own voting power of ₳{{ada}} is in progress of being delegated. You are going to vote ‘NO’ as default.", }, }, - govActions: { - description: "Review governance actions submitted on-chain.", - reviewAndVote: "Review and vote", - title: "Governance Actions", - view: "View governance actions", - }, - proposeGovernanceAction: { - title: "Propose a Governance Action", - description: "Submit your proposal for a Governance Action.", - propose: "Propose", - view: "View governance actions", - }, - registration: { - changeMetadata: "Change metadata", - dRepRegistration: "DRep Registration", - dRepRetirement: "DRep Retirement", - dRepUpdate: "DRep Update", - holdersCanDelegate: - "Ada holders can delegate their voting power to you.", - ifYouWant: - "If you want to directly participate in voting and have other ada holders delegate their voting power to you.", - metadataUpdateInProgress: - "The update DRep metadata is ongoing. This may take several minutes.", - register: "Register", - registerAgain: "Register Again as a dRep", - registerAsDRep: "Register as a DRep", - registrationInProgress: - "The registration process is ongoing. This may take several minutes.", - reRegister: "Re-register as a DRep", - retire: "Retire as a DRep", - retirementInProgress: - "The retirement process is ongoing. This may take several minutes.", - youAreRegistered: "You are Registered as a DRep", - }, - soleVoter: { - isRegisteredDescription: - "Your Voting Power of ₳{{votingPower}} can be used to vote.", - register: "Register", - registerDescription: - "Vote on Governance Actions using your own voting power of ₳{{votingPower}}.", - registerTitle: "Become a Sole Voter", - reRegister: "Re-register", - registration: "Sole Voter Registration", - registrationInProgress: - "The registration process is ongoing. This may take several minutes.", - retire: "Retire", - wasSoleVoterTitle: "You Have Retired as a Sole Voter", - retirement: "Sole 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 ₳{{votingPower}}. until you re-register.", - youAreSoleVoterTitle: "You are a Sole Voter", - }, }, createGovernanceAction: { chooseGATypeTitle: "Choose a Governance Action type", @@ -697,10 +711,9 @@ export const en = { filter: "Filter", goBack: "Go back", here: "here", - inProgress: "In progress", + inProgress: "In Progress", learnMore: "Learn more", loading: "Loading...", - myDRepId: "My DRep ID:", nextStep: "Next step", no: "No", ok: "Ok", diff --git a/govtool/frontend/src/pages/RegisterAsdRep.tsx b/govtool/frontend/src/pages/RegisterAsdRep.tsx index e0b5dafcd..fc2d1430f 100644 --- a/govtool/frontend/src/pages/RegisterAsdRep.tsx +++ b/govtool/frontend/src/pages/RegisterAsdRep.tsx @@ -69,7 +69,10 @@ export const RegisterAsdRep = () => { - + Date: Wed, 3 Apr 2024 17:46:20 +0200 Subject: [PATCH 2/2] [#578] fix translations --- govtool/frontend/src/i18n/locales/en.ts | 1 + govtool/frontend/src/pages/Dashboard.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/govtool/frontend/src/i18n/locales/en.ts b/govtool/frontend/src/i18n/locales/en.ts index 4ddb5b5df..1188ff912 100644 --- a/govtool/frontend/src/i18n/locales/en.ts +++ b/govtool/frontend/src/i18n/locales/en.ts @@ -714,6 +714,7 @@ export const en = { inProgress: "In Progress", learnMore: "Learn more", loading: "Loading...", + myDRepId: "My dRep ID:", nextStep: "Next step", no: "No", ok: "Ok", diff --git a/govtool/frontend/src/pages/Dashboard.tsx b/govtool/frontend/src/pages/Dashboard.tsx index 1483ab7fb..80c9797b1 100644 --- a/govtool/frontend/src/pages/Dashboard.tsx +++ b/govtool/frontend/src/pages/Dashboard.tsx @@ -22,7 +22,7 @@ export const Dashboard = () => { return t("dashboard.title"); } if (path.includes(PATHS.dashboardGovernanceActions)) { - return t("dashboard.govActions.title"); + return t("govActions.title"); } return ""; };