Skip to content

Commit

Permalink
[DDW-893] Dialogs - init
Browse files Browse the repository at this point in the history
  • Loading branch information
thedanheller committed Sep 11, 2019
1 parent 1e81111 commit fd8b7fa
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
Expand Up @@ -25,7 +25,8 @@ import styles from './WalletRecoveryPhraseStep1Dialog.scss';
// });

type Props = {
onContinue: Date,
onContinue: Function,
onClose: Function,
};

@observer
Expand All @@ -35,15 +36,15 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props> {
// };
render() {
// const { intl } = this.context;
const { onContinue } = this.props;
const { onContinue, onClose } = this.props;
const isSubmitting = false;

const actions = [
{
className: isSubmitting ? styles.isSubmitting : null,
label: 'Continue',
primary: true,
onClick: this.submit,
onClick: onContinue,
},
];

Expand All @@ -53,7 +54,7 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props> {
title="Wallet recovery phrase verification"
actions={actions}
closeOnOverlayClick
onClose={onContinue}
onClose={onClose}
closeButton={<DialogCloseButton />}
>
<p>
Expand Down
Expand Up @@ -25,25 +25,43 @@ import styles from './WalletRecoveryPhraseStep1Dialog.scss';
// });

type Props = {
onContinue: Date,
onVerify: Function,
onClose: Function,
};

type State = {
isVeryfying: boolean,
};

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

state = {
isVeryfying: false,
};

handleVerify = () => {
this.setState({
isVeryfying: true,
});
this.props.onVerify();
};

render() {
// const { intl } = this.context;
const { onContinue } = this.props;
const isSubmitting = false;
const { onClose } = this.props;
const { isVeryfying } = this.state;

const actions = [
{
className: isSubmitting ? styles.isSubmitting : null,
label: 'Continue',
className: isVeryfying ? styles.isVeryfying : null,
label: 'Verify',
primary: true,
onClick: this.submit,
disabled: isVeryfying,
},
];

Expand All @@ -53,7 +71,7 @@ export default class WalletRecoveryPhraseStep1 extends Component<Props> {
title="Wallet recovery phrase verification"
actions={actions}
closeOnOverlayClick
onClose={onContinue}
onClose={onClose}
closeButton={<DialogCloseButton />}
>
<p>
Expand Down
Expand Up @@ -8,6 +8,12 @@ export default class WalletRecoveryPhraseStep1Container extends Component {
handleContinue = () => {};

render() {
return <WalletRecoveryPhraseStep1Dialog onContinue={this.handleContinue} />;
// daedalus.actions.dialogs.closeActiveDialog
return (
<WalletRecoveryPhraseStep1Dialog
onContinue={this.handleContinue}
onClose={() => {}}
/>
);
}
}
1 change: 1 addition & 0 deletions storybook/stories/support/utils.js
Expand Up @@ -29,6 +29,7 @@ export const generateWallet = (name: string, amount: string) =>
new Wallet({
id: generateHash(),
amount: new BigNumber(amount).dividedBy(LOVELACES_PER_ADA),
createdAt: new Date(),
name,
assurance: 'normal',
hasPassword: false,
Expand Down

0 comments on commit fd8b7fa

Please sign in to comment.