2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { compose } from 'redux';
|
|
|
|
import { withRouter } from 'react-router-dom';
|
2022-03-16 23:15:03 +01:00
|
|
|
import { editTransaction } from '../../ducks/send';
|
2021-02-04 19:15:23 +01:00
|
|
|
import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck';
|
2022-03-16 23:15:03 +01:00
|
|
|
import { ASSET_TYPES } from '../../../shared/constants/transaction';
|
2021-02-04 19:15:23 +01:00
|
|
|
import ConfirmSendEther from './confirm-send-ether.component';
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapStateToProps = (state) => {
|
2020-11-03 00:41:28 +01:00
|
|
|
const {
|
|
|
|
confirmTransaction: { txData: { txParams } = {} },
|
2021-02-04 19:15:23 +01:00
|
|
|
} = state;
|
2018-07-12 02:34:41 +02:00
|
|
|
|
|
|
|
return {
|
|
|
|
txParams,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2018-07-12 02:34:41 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
2018-06-23 08:52:45 +02:00
|
|
|
return {
|
2021-07-16 18:06:32 +02:00
|
|
|
editTransaction: async (txData) => {
|
2021-06-23 23:35:25 +02:00
|
|
|
const { id } = txData;
|
2021-07-16 18:06:32 +02:00
|
|
|
await dispatch(editTransaction(ASSET_TYPES.NATIVE, id.toString()));
|
2021-02-04 19:15:23 +01:00
|
|
|
dispatch(clearConfirmTransaction());
|
2018-06-23 08:52:45 +02:00
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withRouter,
|
2020-07-14 17:20:41 +02:00
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
2021-02-04 19:15:23 +01:00
|
|
|
)(ConfirmSendEther);
|