-
Notifications
You must be signed in to change notification settings - Fork 293
/
Step3ResultContainer.js
51 lines (48 loc) · 1.58 KB
/
Step3ResultContainer.js
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
// @flow
import React, { Component } from 'react';
import { observer, inject } from 'mobx-react';
import Step3SuccessDialog from '../../../../components/staking/redeem-itn-rewards/Step3SuccessDialog';
import Step3FailureDialog from '../../../../components/staking/redeem-itn-rewards/Step3FailureDialog';
import type { InjectedDialogContainerStepProps } from '../../../../types/injectedPropsType';
import { InjectedDialogContainerStepDefaultProps } from '../../../../types/injectedPropsType';
type Props = InjectedDialogContainerStepProps;
const DefaultProps = InjectedDialogContainerStepDefaultProps;
@inject('stores', 'actions')
@observer
export default class Step3ResultContainer extends Component<Props> {
static defaultProps = DefaultProps;
render() {
const { onBack, onClose, stores, actions } = this.props;
const {
redeemWallet,
rewardsTotal,
transactionFees,
finalTotal,
stakingSuccess,
stakingFailure,
} = stores.staking;
const { onResultContinue } = actions.staking;
if (!redeemWallet) throw new Error('Redeem wallet required');
if (stakingSuccess) {
return (
<Step3SuccessDialog
wallet={redeemWallet}
rewardsTotal={rewardsTotal}
transactionFees={transactionFees}
finalTotal={finalTotal}
error1
onClose={onClose}
onContinue={onResultContinue.trigger}
onBack={onBack}
/>
);
}
return (
<Step3FailureDialog
onClose={onClose}
onBack={onBack}
stakingFailure={stakingFailure}
/>
);
}
}