diff --git a/packages/yoroi-extension/app/components/wallet/voting/Voting.js b/packages/yoroi-extension/app/components/wallet/voting/Voting.js index 6e9c6ad4d9..520308b043 100644 --- a/packages/yoroi-extension/app/components/wallet/voting/Voting.js +++ b/packages/yoroi-extension/app/components/wallet/voting/Voting.js @@ -31,12 +31,21 @@ const messages = defineMessages({ id: 'wallet.voting.line4', defaultMessage: '!!!Open the Catalyst Voting App and click on the Complete registration button.', }, + notDelegated: { + id: 'wallet.voting.notDelegated', + defaultMessage: '!!!You have not delegated. Your voting power is how much you delegate and the voting rewards will be distributed to your delegation reward address. Please make sure to delegate before voting.', + }, + keepDelegated: { + id: 'wallet.voting.keepDelegated', + defaultMessage: '!!!Your voting power is how much you delegate and the voting rewards will be distributed to your delegation reward address. Please keep delegated until the voting ends.', + }, }); type Props = {| +start: void => void, +onExternalLinkClick: MouseEvent => void, +hasAnyPending: boolean, + +isDelegated: boolean, |}; @observer @@ -108,6 +117,22 @@ export default class Voting extends Component { +
+ {this.props.isDelegated ? + ( +
+ {intl.formatMessage(messages.keepDelegated)} +
+ ) : + ( +
+ + {intl.formatMessage(messages.notDelegated)} + +
+ ) + } +
); @@ -152,6 +184,9 @@ export default class VotingPage extends Component { wallets: {| selected: null | PublicDeriver<>, |}, + delegation: {| + getDelegationRequests: (PublicDeriver<>) => void | DelegationRequests, + |}, |}, |} { if (this.props.generated !== undefined) { @@ -197,6 +232,9 @@ export default class VotingPage extends Component { tokenInfoStore: { tokenInfo: stores.tokenInfoStore.tokenInfo, }, + delegation: { + getDelegationRequests: stores.delegation.getDelegationRequests, + }, }, VotingRegistrationDialogProps: ({ actions, diff --git a/packages/yoroi-extension/app/containers/wallet/voting/VotingPage.stories.js b/packages/yoroi-extension/app/containers/wallet/voting/VotingPage.stories.js index 302a7c3c65..6bd2ef6545 100644 --- a/packages/yoroi-extension/app/containers/wallet/voting/VotingPage.stories.js +++ b/packages/yoroi-extension/app/containers/wallet/voting/VotingPage.stories.js @@ -64,6 +64,9 @@ const defaultProps: ({| tokenInfoStore: { tokenInfo: mockFromDefaults(defaultAssets), }, + delegation: { + getDelegationRequests: walletLookup([request.wallet]).getDelegation, + }, }, actions: { dialogs: { diff --git a/packages/yoroi-extension/app/i18n/locales/en-US.json b/packages/yoroi-extension/app/i18n/locales/en-US.json index 1065f6bf4f..fbdee6b9d1 100644 --- a/packages/yoroi-extension/app/i18n/locales/en-US.json +++ b/packages/yoroi-extension/app/i18n/locales/en-US.json @@ -779,10 +779,12 @@ "wallet.voting.dialog.stepQrCode": "QR Code", "wallet.voting.dialog.title": "Register for Voting", "wallet.voting.dialog.transactionLabel": "Transaction", + "wallet.voting.keepDelegated": "Your voting power is how much you delegate and the voting rewards will be distributed to your delegation reward address. Please keep delegated until the voting ends.", "wallet.voting.line2": "Before you begin, make sure to complete steps below", "wallet.voting.line3": "Download the Catalyst Voting App.", "wallet.voting.line4": "Open the Catalyst Voting App and click on the Complete registration button.", "wallet.voting.lineTitle": "Register to vote on Fund 3", + "wallet.voting.notDelegated": "You have not delegated. Your voting power is how much you delegate and the voting rewards will be distributed to your delegation reward address. Please make sure to delegate before voting.", "wallet.withdrawal.transaction.unregister": "This transaction will unregister one or more staking keys, giving you back your {refundAmount} {ticker} from your deposit", "widgets.copyableaddress.addressCopyTooltipMessage": "Copy to clipboard", "widgets.explorer.tooltip": "Go to {websiteName}",