-
Notifications
You must be signed in to change notification settings - Fork 295
/
VotingNoWallets.tsx
69 lines (64 loc) · 2.31 KB
/
VotingNoWallets.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// @flow
import React, { Component } from 'react';
import { defineMessages, intlShape } from 'react-intl';
import SVGInline from 'react-svg-inline';
import BigNumber from 'bignumber.js';
import { Button } from 'react-polymorph/lib/components/Button';
import { ButtonSkin } from 'react-polymorph/lib/skins/simple/ButtonSkin';
import styles from './VotingNoWallets.scss';
import icon from '../../assets/images/attention-big-thin.inline.svg';
import { NEXT_VOTING_FUND_NUMBER } from '../../config/votingConfig';
const messages = defineMessages({
headLine: {
id: 'voting.info.noWallets.headLine',
defaultMessage:
'!!!Voting registration for Fund{nextVotingFundNumber} is not available as you currently do not have any Shelley-compatible wallets.',
description: '"No wallets" headLine on the voting info page.',
},
instructions: {
id: 'voting.info.noWallets.instructions',
defaultMessage:
'!!!Create a new wallet and transfer a minimum of {minVotingFunds} ADA (or restore an existing wallet with funds), then return here to register for voting.',
description: '"No wallets" instructions on the voting info page.',
},
createWalletButtonLabel: {
id: 'voting.info.noWallets.createWalletButtonLabel',
defaultMessage: '!!!Create wallet',
description:
'Label for "Create New Wallet" button on the voting info page.',
},
});
type Props = {
onGoToCreateWalletClick: Function,
minVotingFunds: number,
};
export default class VotingNoWallets extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
const { intl } = this.context;
const { onGoToCreateWalletClick, minVotingFunds } = this.props;
return (
<div className={styles.component}>
<SVGInline svg={icon} className={styles.icon} />
<h1>
{intl.formatMessage(messages.headLine, {
nextVotingFundNumber: NEXT_VOTING_FUND_NUMBER,
})}
</h1>
<p>
{intl.formatMessage(messages.instructions, {
minVotingFunds: new BigNumber(minVotingFunds).toFormat(0),
})}
</p>
<Button
className="primary"
onClick={onGoToCreateWalletClick}
label={intl.formatMessage(messages.createWalletButtonLabel)}
skin={ButtonSkin}
/>
</div>
);
}
}