-
Notifications
You must be signed in to change notification settings - Fork 295
/
Step3FailureDialog.tsx
101 lines (93 loc) · 3.25 KB
/
Step3FailureDialog.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';
import SVGInline from 'react-svg-inline';
import DialogCloseButton from '../../widgets/DialogCloseButton';
import Dialog from '../../widgets/Dialog';
import styles from './Step3FailureDialog.scss';
import sadWalletImage from '../../../assets/images/sad-wallet.inline.svg';
import closeCrossThin from '../../../assets/images/close-cross-thin.inline.svg';
const messages = defineMessages({
description1NoRewards: {
id: 'staking.redeemItnRewards.step3.failure.description1NoRewards',
defaultMessage:
'!!!No rewards were found in your Incentivized Testnet Rewards wallet. Please make sure that you have entered the correct wallet recovery phrase.',
description: 'description for Redeem Incentivized Testnet - Step 3',
},
description2InvalidWallet: {
id: 'staking.redeemItnRewards.step3.failure.description2InvalidWallet',
defaultMessage:
'!!!Rewards from the wallet corresponding to the recovery phrase you have provided have already been redeemed.',
description: 'description for Redeem Incentivized Testnet - Step 3',
},
description3Generic: {
id: 'staking.redeemItnRewards.step3.failure.description3Generic',
defaultMessage:
'!!!No rewards were found in your Incentivized Testnet Rewards wallet. Please make sure that you have entered the correct wallet recovery phrase and that rewards have not already been redeemed.',
description: 'description for Redeem Incentivized Testnet - Step 3',
},
backButtonLabel: {
id: 'staking.redeemItnRewards.step3.failure.backButtonLabel',
defaultMessage: '!!!Back',
description: 'backButtonLabel for Redeem Incentivized Testnet - Step 3',
},
closeWindowLinkLabel: {
id: 'staking.redeemItnRewards.step3.failure.closeWindowLinkLabel',
defaultMessage: '!!!Close window',
description:
'closeWindowLinkLabel for Redeem Incentivized Testnet - Step 3',
},
});
type Props = {
onClose: Function,
onBack: Function,
};
@observer
export default class Step3FailureDialog extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
const { intl } = this.context;
const { onClose, onBack } = this.props;
const actions = {
direction: 'column',
items: [
{
primary: true,
label: intl.formatMessage(messages.backButtonLabel),
onClick: onBack,
},
{
onClick: onClose,
label: intl.formatMessage(messages.closeWindowLinkLabel),
isLink: true,
hasIconAfter: false,
},
],
};
const description = messages.description1NoRewards;
const closeButton = (
<DialogCloseButton
icon={closeCrossThin}
className={styles.closeButton}
onClose={onClose}
/>
);
return (
<Dialog
actions={actions}
onClose={onClose}
closeButton={closeButton}
closeOnOverlayClick={false}
fullSize
>
<SVGInline svg={sadWalletImage} className={styles.sadWalletImage} />
<div className={styles.description}>
{intl.formatMessage(description)}
</div>
</Dialog>
);
}
}