Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Catalyst round Info in UI #2114

Merged
merged 2 commits into from
May 28, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import styles from './Voting.scss';
const messages = defineMessages({
lineTitle: {
id: 'wallet.voting.lineTitle',
defaultMessage: '!!!Register to vote on Fund 3',
defaultMessage: '!!!Register to vote on Fund {round}',
},
line2: {
id: 'wallet.voting.line2',
Expand Down Expand Up @@ -46,6 +46,7 @@ type Props = {|
+onExternalLinkClick: MouseEvent => void,
+hasAnyPending: boolean,
+isDelegated: boolean,
+round: number,
|};

@observer
Expand All @@ -57,6 +58,8 @@ export default class Voting extends Component<Props> {
render(): Node {
const { intl } = this.context;

const round = this.props.round;

const pendingTxWarningComponent = this.props.hasAnyPending
? (
<div className={styles.warningBox}>
Expand All @@ -76,7 +79,7 @@ export default class Voting extends Component<Props> {
{pendingTxWarningComponent}
<div className={styles.voting}>
<div className={classnames([styles.lineTitle, styles.firstItem])}>
{intl.formatMessage(messages.lineTitle)}
{intl.formatMessage(messages.lineTitle, { round })}
</div>

<div className={styles.lineText}>
Expand Down
4 changes: 3 additions & 1 deletion packages/yoroi-extension/app/config/numbersConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ export const CARDANO_STABLE_SIZE = 2160;
*/
export const ERGO_STABLE_SIZE = Number.MAX_SAFE_INTEGER / 2;

// Catalyst fund 3 requires > 2950 ADA to participate
// Catalyst fund 4 *technically* requires > 450 ADA to participate
// However, the official min amount is 500 ADA
export const CATALYST_MIN_AMOUNT: BigNumber = new BigNumber(450 * 1_000_000);
export const CATALYST_DISPLAYED_MIN_AMOUNT: BigNumber = new BigNumber(500 * 1_000_000);
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import UnsupportedWallet from '../UnsupportedWallet';
import { PublicDeriver } from '../../../api/ada/lib/storage/models/PublicDeriver/index';
import LoadingSpinner from '../../../components/widgets/LoadingSpinner';
import VerticallyCenteredLayout from '../../../components/layout/VerticallyCenteredLayout';
import { CATALYST_MIN_AMOUNT } from '../../../config/numbersConfig';
import { CATALYST_MIN_AMOUNT, CATALYST_DISPLAYED_MIN_AMOUNT } from '../../../config/numbersConfig';
import InsufficientFundsPage from './InsufficientFundsPage';
import { getTokenName, genLookupOrFail } from '../../../stores/stateless/tokenHelpers';
import type { TokenInfoMap } from '../../../stores/toplevel/TokenInfoStore';
Expand Down Expand Up @@ -131,7 +131,9 @@ export default class VotingPage extends Component<Props> {
currentBalance={
balance.getDefaultEntry().amount.shiftedBy(-tokenInfo.Metadata.numberOfDecimals)
}
requiredBalance={CATALYST_MIN_AMOUNT.shiftedBy(-tokenInfo.Metadata.numberOfDecimals)}
requiredBalance={
CATALYST_DISPLAYED_MIN_AMOUNT.shiftedBy(-tokenInfo.Metadata.numberOfDecimals)
}
tokenName={getTokenName(tokenInfo)}
/>;
}
Expand All @@ -152,6 +154,7 @@ export default class VotingPage extends Component<Props> {
hasAnyPending={this.generated.hasAnyPending}
onExternalLinkClick={handleExternalLinkClick}
isDelegated={this.isDelegated === true}
round={roundInfo.nextRound}
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/app/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@
"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.lineTitle": "Register to vote on Fund { round }",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/yoroi-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.