Skip to content
Permalink
Browse files

[DDW-893] Dialogs - intl

  • Loading branch information...
daniloprates committed Sep 11, 2019
1 parent 56feb60 commit f2c2b5cc1cc29c8a4c9608401849b90faef59007
@@ -28,6 +28,11 @@ export const messages = defineMessages({
description:
'Label for the recoveryPhraseStep1Paragraph2 on wallet settings.',
},
recoveryPhraseStep1Button: {
id: 'wallet.settings.recoveryPhraseStep1Button',
defaultMessage: '!!!Continue',
description: 'Label for the recoveryPhraseStep1Button on wallet settings.',
},
});

type Props = {
@@ -55,7 +60,7 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props> {
const actions = [
{
className: isSubmitting ? styles.isSubmitting : null,
label: 'Continue',
label: intl.formatMessage(messages.recoveryPhraseStep1Button),
primary: true,
onClick: onContinue,
disabled: !safetyAgreement,
@@ -65,26 +70,21 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props> {
return (
<Dialog
className={styles.dialog}
title="Wallet recovery phrase verification"
title={intl.formatMessage(messages.recoveryPhraseStep1Title)}
actions={actions}
closeOnOverlayClick
onClose={onClose}
closeButton={<DialogCloseButton />}
>
<p>
To verify that you have the correct recovery phrase for this wallet
you can enter your 12-word wallet recovery phrase on the following
screen.
</p>
<p>{intl.formatMessage(messages.recoveryPhraseStep1Paragraph1)}</p>
<p className={styles.checkboxContainer}>
<Checkbox
onChange={onToggleSafetyAgreement}
checked={safetyAgreement}
skin={CheckboxSkin}
className={styles.checkbox}
/>
Are you being watched? Please make sure that nobody can see your
screen while you are entering your wallet recovery phrase.
{intl.formatMessage(messages.recoveryPhraseStep1Paragraph2)}
</p>
</Dialog>
);
@@ -1,28 +1,36 @@
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
// import { defineMessages, intlShape } from 'react-intl';
import { defineMessages, intlShape } from 'react-intl';
import DialogCloseButton from '../../widgets/DialogCloseButton';
import Dialog from '../../widgets/Dialog';
import styles from './WalletRecoveryPhraseStepDialogs.scss';

// export const messages = defineMessages({
// recoveryPhraseStep1Title: {
// id: 'wallet.settings.recoveryPhraseStep1Title',
// defaultMessage: '!!!Wallet recovery phrase verification',
// description: 'Label for the recoveryPhraseStep1Title on wallet settings.',
// },
// recoveryPhraseStep1Paragraph1: {
// id: 'wallet.settings.recoveryPhraseStep1Paragraph1',
// defaultMessage: '!!!To verify that you have the correct recovery phrase for this wallet you can enter your 12-word wallet recovery phrase on the following screen.',
// description: 'Label for the recoveryPhraseStep1Paragraph1 on wallet settings.',
// },
// recoveryPhraseStep1Paragraph2: {
// id: 'wallet.settings.recoveryPhraseStep1Paragraph2',
// defaultMessage: '!!!Are you being watched? Please make sure that nobody can see your screen while you are entering your wallet recovery phrase.',
// description: 'Label for the recoveryPhraseStep1Paragraph2 on wallet settings.',
// },
// });
export const messages = defineMessages({
recoveryPhraseStep2Title: {
id: 'wallet.settings.recoveryPhraseStep2Title',
defaultMessage: '!!!Wallet recovery phrase verification',
description: 'Label for the recoveryPhraseStep2Title on wallet settings.',
},
recoveryPhraseStep2Description: {
id: 'wallet.settings.recoveryPhraseStep2Description',
defaultMessage:
'!!!Please enter your 12-word wallet recovery phrase. Make sure you enter the words in the correct order.',
description:
'Label for the recoveryPhraseStep2Description on wallet settings.',
},
recoveryPhraseStep2Subtitle: {
id: 'wallet.settings.recoveryPhraseStep2Subtitle',
defaultMessage: '!!!Recovery phrase',
description:
'Label for the recoveryPhraseStep2Subtitle on wallet settings.',
},
recoveryPhraseStep2Button: {
id: 'wallet.settings.recoveryPhraseStep2Button',
defaultMessage: '!!!Verify',
description: 'Label for the recoveryPhraseStep2Button on wallet settings.',
},
});

type Props = {
onVerify: Function,
@@ -35,9 +43,9 @@ type State = {

@observer
export default class WalletRecoveryPhraseStep1 extends Component<Props, State> {
// static contextTypes = {
// intl: intlShape.isRequired,
// };
static contextTypes = {
intl: intlShape.isRequired,
};

state = {
isVeryfying: false,
@@ -51,41 +59,42 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props, State> {
};

render() {
// const { intl } = this.context;
const { intl } = this.context;
const { onClose, onVerify } = this.props;
const { isVeryfying } = this.state;

const actions = [
{
className: isVeryfying ? styles.isVeryfying : null,
label: 'Verify - successfuly',
label: `${intl.formatMessage(
messages.recoveryPhraseStep2Button
)} - successfuly`,
primary: true,
onClick: () => onVerify(true),
disabled: isVeryfying,
},
{
className: isVeryfying ? styles.isVeryfying : null,
label: 'Verify - failure',
label: `${intl.formatMessage(
messages.recoveryPhraseStep2Button
)} - failure`,
onClick: () => onVerify(false),
className: 'attention',
disabled: isVeryfying,
},
];

return (
<Dialog
className={styles.dialog}
title="Wallet recovery phrase verification"
title={intl.formatMessage(messages.recoveryPhraseStep2Title)}
actions={actions}
closeOnOverlayClick
onClose={onClose}
closeButton={<DialogCloseButton />}
>
<p>
Please enter your 12-word wallet recovery phrase. Make sure you enter
the words in the correct order.
</p>
<p>{intl.formatMessage(messages.recoveryPhraseStep2Description)}</p>
<div className={styles.subtitle}>
<h2>Recovery phrase</h2>
<h2>{intl.formatMessage(messages.recoveryPhraseStep2Subtitle)}</h2>
</div>
</Dialog>
);
@@ -1,30 +1,39 @@
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
// import { defineMessages, intlShape } from 'react-intl';
import { defineMessages, intlShape } from 'react-intl';
import { Checkbox } from 'react-polymorph/lib/components/Checkbox';
import { CheckboxSkin } from 'react-polymorph/lib/skins/simple/CheckboxSkin';
import DialogCloseButton from '../../widgets/DialogCloseButton';
import Dialog from '../../widgets/Dialog';
import styles from './WalletRecoveryPhraseStepDialogs.scss';

// export const messages = defineMessages({
// recoveryPhraseStep1Title: {
// id: 'wallet.settings.recoveryPhraseStep1Title',
// defaultMessage: '!!!Wallet recovery phrase verification',
// description: 'Label for the recoveryPhraseStep1Title on wallet settings.',
// },
// recoveryPhraseStep1Paragraph1: {
// id: 'wallet.settings.recoveryPhraseStep1Paragraph1',
// defaultMessage: '!!!To verify that you have the correct recovery phrase for this wallet you can enter your 12-word wallet recovery phrase on the following screen.',
// description: 'Label for the recoveryPhraseStep1Paragraph1 on wallet settings.',
// },
// recoveryPhraseStep1Paragraph2: {
// id: 'wallet.settings.recoveryPhraseStep1Paragraph2',
// defaultMessage: '!!!Are you being watched? Please make sure that nobody can see your screen while you are entering your wallet recovery phrase.',
// description: 'Label for the recoveryPhraseStep1Paragraph2 on wallet settings.',
// },
// });
export const messages = defineMessages({
recoveryPhraseStep3Title: {
id: 'wallet.settings.recoveryPhraseStep3Title',
defaultMessage: '!!!verification successful',
description: 'Label for the recoveryPhraseStep3Title on wallet settings.',
},
recoveryPhraseStep3Paragraph1: {
id: 'wallet.settings.recoveryPhraseStep3Paragraph1',
defaultMessage:
'!!!You have verified the recovery phrase for this wallet. You can use it at any time to recover the funds in this wallet on another computer, even if using a different version of Daedalus.',
description:
'Label for the recoveryPhraseStep3Paragraph1 on wallet settings.',
},
recoveryPhraseStep3Paragraph2: {
id: 'wallet.settings.recoveryPhraseStep3Paragraph2',
defaultMessage:
'!!!Please make sure to keep the paper with your wallet recovery phrase in a safe place. Anyone with access to your wallet recovery phrase can take control of your funds.',
description:
'Label for the recoveryPhraseStep3Paragraph2 on wallet settings.',
},
recoveryPhraseStep3Button: {
id: 'wallet.settings.recoveryPhraseStep3Button',
defaultMessage: '!!!Continue',
description: 'Label for the recoveryPhraseStep3Button on wallet settings.',
},
});

type Props = {
onClose: Function,
@@ -34,11 +43,11 @@ type Props = {

@observer
export default class WalletRecoveryPhraseStep1 extends Component<Props> {
// static contextTypes = {
// intl: intlShape.isRequired,
// };
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
// const { intl } = this.context;
const { intl } = this.context;
const { onClose, onToggleSafetyAgreement, safetyAgreement } = this.props;

const actions = [
@@ -53,27 +62,21 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props> {
return (
<Dialog
className={styles.dialog}
title="verification successful"
title={intl.formatMessage(messages.recoveryPhraseStep3Title)}
actions={actions}
closeOnOverlayClick
onClose={onClose}
closeButton={<DialogCloseButton />}
>
<p>
You have verified the recovery phrase for this wallet. You can use it
at any time to recover the funds in this wallet on another computer,
even if using a different version of Daedalus.
</p>
<p>{intl.formatMessage(messages.recoveryPhraseStep3Paragraph1)}</p>
<p className={styles.checkboxContainer}>
<Checkbox
onChange={onToggleSafetyAgreement}
checked={safetyAgreement}
skin={CheckboxSkin}
className={styles.checkbox}
/>
Please make sure to keep the paper with your wallet recovery phrase in
a safe place. Anyone with access to your wallet recovery phrase can
take control of your funds.
{intl.formatMessage(messages.recoveryPhraseStep3Paragraph2)}
</p>
</Dialog>
);
@@ -1,28 +1,37 @@
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
// import { defineMessages, intlShape } from 'react-intl';
import { defineMessages, intlShape } from 'react-intl';
import DialogCloseButton from '../../widgets/DialogCloseButton';
import Dialog from '../../widgets/Dialog';
import styles from './WalletRecoveryPhraseStepDialogs.scss';

// export const messages = defineMessages({
// recoveryPhraseStep1Title: {
// id: 'wallet.settings.recoveryPhraseStep1Title',
// defaultMessage: '!!!Wallet recovery phrase verification',
// description: 'Label for the recoveryPhraseStep1Title on wallet settings.',
// },
// recoveryPhraseStep1Paragraph1: {
// id: 'wallet.settings.recoveryPhraseStep1Paragraph1',
// defaultMessage: '!!!To verify that you have the correct recovery phrase for this wallet you can enter your 12-word wallet recovery phrase on the following screen.',
// description: 'Label for the recoveryPhraseStep1Paragraph1 on wallet settings.',
// },
// recoveryPhraseStep1Paragraph2: {
// id: 'wallet.settings.recoveryPhraseStep1Paragraph2',
// defaultMessage: '!!!Are you being watched? Please make sure that nobody can see your screen while you are entering your wallet recovery phrase.',
// description: 'Label for the recoveryPhraseStep1Paragraph2 on wallet settings.',
// },
// });
export const messages = defineMessages({
recoveryPhraseStep4Title: {
id: 'wallet.settings.recoveryPhraseStep4Title',
defaultMessage: '!!!verification failure',
description: 'Label for the recoveryPhraseStep4Title on wallet settings.',
},
recoveryPhraseStep4Paragraph1: {
id: 'wallet.settings.recoveryPhraseStep4Paragraph1',
defaultMessage:
'!!!The wallet recovery phrase you have entered does not match the recovery phrase associated with this wallet. Make sure you have entered the wallet recovery phrase which was written down during the wallet creation process for this wallet and make sure the words are in the correct order.',
description:
'Label for the recoveryPhraseStep4Paragraph1 on wallet settings.',
},
recoveryPhraseStep4Paragraph2: {
id: 'wallet.settings.recoveryPhraseStep4Paragraph2',
defaultMessage:
'!!!If you are unable to verify your wallet recovery phrase you should create a new wallet and move all of the funds from this wallet to the new wallet. If you do this, make sure you keep the wallet recovery phrase for the new wallet safe and secure.',
description:
'Label for the recoveryPhraseStep4Paragraph2 on wallet settings.',
},
recoveryPhraseStep4Button: {
id: 'wallet.settings.recoveryPhraseStep4Button',
defaultMessage: '!!!Verify recovery phrase again',
description: 'Label for the recoveryPhraseStep4Button on wallet settings.',
},
});

type Props = {
onClose: Function,
@@ -31,16 +40,16 @@ type Props = {

@observer
export default class WalletRecoveryPhraseStep1 extends Component<Props> {
// static contextTypes = {
// intl: intlShape.isRequired,
// };
static contextTypes = {
intl: intlShape.isRequired,
};
render() {
// const { intl } = this.context;
const { intl } = this.context;
const { onClose, onVerifyAgain } = this.props;

const actions = [
{
label: 'Verify recovery phrase again',
label: intl.formatMessage(messages.recoveryPhraseStep4Button),
onClick: onVerifyAgain,
className: 'attention',
},
@@ -49,25 +58,14 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props> {
return (
<Dialog
className={styles.dialog}
title="verification failure"
title={intl.formatMessage(messages.recoveryPhraseStep4Title)}
actions={actions}
closeOnOverlayClick
onClose={onClose}
closeButton={<DialogCloseButton />}
>
<p>
The wallet recovery phrase you have entered does not match the
recovery phrase associated with this wallet. Make sure you have
entered the wallet recovery phrase which was written down during the
wallet creation process for this wallet and make sure the words are in
the correct order.
</p>
<p>
If you are unable to verify your wallet recovery phrase you should
create a new wallet and move all of the funds from this wallet to the
new wallet. If you do this, make sure you keep the wallet recovery
phrase for the new wallet safe and secure.
</p>
<p>{intl.formatMessage(messages.recoveryPhraseStep4Paragraph1)}</p>
<p>{intl.formatMessage(messages.recoveryPhraseStep4Paragraph2)}</p>
</Dialog>
);
}

0 comments on commit f2c2b5c

Please sign in to comment.
You can’t perform that action at this time.