Skip to content

Commit

Permalink
update base DRep registration cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed Feb 12, 2024
1 parent 3ce9ea8 commit bef311b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 25 deletions.
34 changes: 18 additions & 16 deletions govtool/frontend/src/components/organisms/DashboardCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export const DashboardCards = () => {
} else if (dRep?.isRegistered || dRep?.wasRegistered) {
return t("dashboard.registration.holdersCanDelegate");
} else {
return t("dashboard.registration.ifYouWant");
return t("dashboard.cards.registerAsDRepDescription");
}
}, [
registerTransaction.transactionHash,
Expand All @@ -250,7 +250,7 @@ export const DashboardCards = () => {
} else if (dRep?.wasRegistered) {
return t("dashboard.registration.registerAgain");
} else {
return t("dashboard.registration.registerAsDRep");
return t("dashboard.cards.registerAsDRepTitle");
}
}, [
registerTransaction?.transactionHash,
Expand Down Expand Up @@ -373,18 +373,14 @@ export const DashboardCards = () => {
/>
<Box width={24} />
<DashboardActionCard
cardId={dRep?.isRegistered || dRep?.wasRegistered ? dRepIDBech32 : ""}
cardTitle={
dRep?.isRegistered || dRep?.wasRegistered ? t("myDRepId") : ""
}
dataTestidFirstButton={
dRep?.isRegistered ? "retire-button" : "register-button"
}
dataTestidDrepIdBox="my-drep-id"
firstButtonVariant={dRep?.isRegistered ? "outlined" : "contained"}
secondButtonVariant={
registerTransaction?.transactionHash
? "outlined"
: dRep?.isRegistered
? "text"
: "outlined"
}
dataTestidSecondButton={
dRep?.isRegistered
? "change-metadata-button"
Expand All @@ -401,13 +397,16 @@ export const DashboardCards = () => {
registerTransaction?.transactionHash
? ""
: t(
`dashboard.registration.${
dRep?.isRegistered ? "retire" : "register"
`dashboard.cards.${
dRep?.isRegistered
? "retireAsDRepFirstButtonLabel"
: "registerAsDRepFirstButtonLabel"
}`
)
}
inProgress={!!registerTransaction?.transactionHash}
firstButtonVariant={dRep?.isRegistered ? "outlined" : "contained"}
imageURL={IMAGES.govActionRegisterImage}
inProgress={!!registerTransaction?.transactionHash}
secondButtonAction={
registerTransaction?.transactionHash
? () => openInNewTab("https://adanordic.com/latest_transactions")
Expand All @@ -427,9 +426,12 @@ export const DashboardCards = () => {
? t("dashboard.registration.changeMetadata")
: t("learnMore")
}
cardId={dRep?.isRegistered || dRep?.wasRegistered ? dRepIDBech32 : ""}
cardTitle={
dRep?.isRegistered || dRep?.wasRegistered ? t("myDRepId") : ""
secondButtonVariant={
registerTransaction?.transactionHash
? "outlined"
: dRep?.isRegistered
? "text"
: "outlined"
}
title={registrationCardTitle}
/>
Expand Down
6 changes: 3 additions & 3 deletions govtool/frontend/src/components/organisms/HomeCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export const HomeCards = () => {
<ActionCard
dataTestIdFirstButton="register-connect-wallet-button"
dataTestIdSecondButton="register-learn-more-button"
description={t("dashboard.registration.description")}
description={t("home.registerAsDRepCardDescription")}
firstButtonAction={() => openModal({ type: "chooseWallet" })}
firstButtonLabel={t("dashboard.registration.connectToRegister")}
firstButtonLabel={t("home.connectToRegister")}
imageHeight={80}
imageURL={IMAGES.govActionRegisterImage}
imageWidth={70}
Expand All @@ -72,7 +72,7 @@ export const HomeCards = () => {
)
}
secondButtonLabel={t("learnMore")}
title={t("dashboard.registration.registerAsDRep")}
title={t("home.registerAsDRepCardTitle")}
/>
</Box>
<Box
Expand Down
22 changes: 16 additions & 6 deletions govtool/frontend/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,27 @@ export const en = {
title: "Governance Actions",
view: "View governance actions",
},
cards: {
registerAsDRepDescription:
"If you want to actively participate in voting and have other Community Members delegate their voting power to you.",
registerAsDRepFirstButtonLabel: "Register",
registerAsDRepTitle: "Become a DRep",
retireAsDRepFirstButtonLabel: "Retire as a DRep",
},
registration: {
changeMetadata: "Change metadata",
connectToRegister: "Connect to register",
dRepRegistration: "DRep Registration",
dRepRetirement: "DRep Retirement",
dRepUpdate: "DRep Update",
description:
"If you want to directly participate in voting and have other ada holders delegate their voting power to you.",
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.",
registerAsDRepCardDescription:
"If you want to actively participate in voting and have other Community Members 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",
registerAsDRepCardTitle: "Become a DRep",
registrationInProgress:
"The registration process is ongoing. This may take several minutes.",
retire: "Retire as a DRep",
Expand Down Expand Up @@ -215,6 +219,12 @@ export const en = {
"Interact with SanchoNet using GovTool - a friendly user\ninterface connected to SanchoNet. You can delegate\nyour voting power (tAda) or become a SanchoNet DRep\nto allow people to delegate voting power to you.",
headline: "SanchoNet \n Governance Tool",
},
home: {
connectToRegister: "Connect to Register",
registerAsDRepCardDescription:
"Accept delegated voting power from other ADA holders, and combine it with your own voting power. Vote with the accumulated Power on Governance Actions.",
registerAsDRepCardTitle: "Become a DRep",
},
menu: {
faqs: "FAQs",
guides: "Guides",
Expand Down

0 comments on commit bef311b

Please sign in to comment.