-
Notifications
You must be signed in to change notification settings - Fork 295
/
SetWalletPassword.tsx
78 lines (72 loc) · 2.63 KB
/
SetWalletPassword.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
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';
import SVGInline from 'react-svg-inline';
import insecureWalletIcon from '../../../assets/images/insecure-wallet.inline.svg';
import styles from './SetWalletPassword.scss';
import ChangeSpendingPasswordDialogContainer from '../../../containers/wallet/dialogs/settings/ChangeSpendingPasswordDialogContainer';
const messages = defineMessages({
setPasswordButton: {
id: 'wallet.settings.setWalletPassword.dialog.setPasswordButton',
defaultMessage: '!!!Set a password',
description:
'Label for the "Set a password" button in the set wallet password dialog.',
},
setPasswordMessage: {
id: 'wallet.settings.setWalletPassword.dialog.setPasswordMessage',
defaultMessage:
'!!!To keep your wallet secure and start using it in Daedalus, you need to set a spending password.',
description:
'Message for the "Set a password" button in the set wallet password dialog.',
},
setPasswordTitle: {
id: 'wallet.settings.setWalletPassword.dialog.setPasswordTitle',
defaultMessage: '!!!Your wallet is not protected with a password',
description:
'Title for the "Set wallet password" dialog when there is not password set.',
},
});
type Props = {
isSetWalletPasswordDialogOpen: boolean,
onSetWalletPassword: Function,
};
@observer
export default class SetWalletPassword extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
const { intl } = this.context;
const { isSetWalletPasswordDialogOpen, onSetWalletPassword } = this.props;
return (
<>
<div className={styles.component}>
<div className={styles.setPasswordDialog}>
<div className={styles.setPasswordWrapper}>
<SVGInline
svg={insecureWalletIcon}
className={styles.insecureWalletIcon}
/>
<h2 className={styles.setPasswordTitle}>
{intl.formatMessage(messages.setPasswordTitle)}
</h2>
<p className={styles.setPasswordMessage}>
{intl.formatMessage(messages.setPasswordMessage)}
</p>
<button
className={styles.setPasswordButton}
onClick={onSetWalletPassword}
>
{intl.formatMessage(messages.setPasswordButton)}
</button>
</div>
</div>
</div>
{isSetWalletPasswordDialogOpen && (
<ChangeSpendingPasswordDialogContainer />
)}
</>
);
}
}