You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.1 KiB
46 lines
1.1 KiB
4 years ago
|
import { connect } from 'react-redux';
|
||
|
import { compose } from 'redux';
|
||
|
import { withRouter } from 'react-router-dom';
|
||
|
import { updateSend } from '../../store/actions';
|
||
|
import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck';
|
||
|
import ConfirmSendEther from './confirm-send-ether.component';
|
||
7 years ago
|
|
||
5 years ago
|
const mapStateToProps = (state) => {
|
||
4 years ago
|
const {
|
||
|
confirmTransaction: { txData: { txParams } = {} },
|
||
4 years ago
|
} = state;
|
||
6 years ago
|
|
||
|
return {
|
||
|
txParams,
|
||
4 years ago
|
};
|
||
|
};
|
||
6 years ago
|
|
||
5 years ago
|
const mapDispatchToProps = (dispatch) => {
|
||
7 years ago
|
return {
|
||
5 years ago
|
editTransaction: (txData) => {
|
||
4 years ago
|
const { id, txParams } = txData;
|
||
|
const { from, gas: gasLimit, gasPrice, to, value: amount } = txParams;
|
||
7 years ago
|
|
||
4 years ago
|
dispatch(
|
||
|
updateSend({
|
||
|
from,
|
||
|
gasLimit,
|
||
|
gasPrice,
|
||
|
gasTotal: null,
|
||
|
to,
|
||
|
amount,
|
||
|
errors: { to: null, amount: null },
|
||
4 years ago
|
editingTransactionId: id?.toString(),
|
||
4 years ago
|
}),
|
||
4 years ago
|
);
|
||
7 years ago
|
|
||
4 years ago
|
dispatch(clearConfirmTransaction());
|
||
7 years ago
|
},
|
||
4 years ago
|
};
|
||
|
};
|
||
7 years ago
|
|
||
|
export default compose(
|
||
|
withRouter,
|
||
4 years ago
|
connect(mapStateToProps, mapDispatchToProps),
|
||
4 years ago
|
)(ConfirmSendEther);
|