2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
2023-02-09 18:45:52 +01:00
|
|
|
import { cancelTx } from '../../../store/actions';
|
2018-04-26 18:38:38 +02:00
|
|
|
import {
|
2021-06-23 23:35:25 +02:00
|
|
|
resetSendState,
|
2021-09-17 06:37:50 +02:00
|
|
|
getSendStage,
|
2018-04-26 18:38:38 +02:00
|
|
|
getSendTo,
|
2019-03-05 16:45:01 +01:00
|
|
|
getSendErrors,
|
2021-06-23 23:35:25 +02:00
|
|
|
isSendFormInvalid,
|
|
|
|
signTransaction,
|
2021-09-17 06:37:50 +02:00
|
|
|
getDraftTransactionID,
|
2021-06-23 23:35:25 +02:00
|
|
|
} from '../../../ducks/send';
|
2021-02-04 19:15:23 +01:00
|
|
|
import { getMostRecentOverviewPage } from '../../../ducks/history/history';
|
2021-06-23 23:35:25 +02:00
|
|
|
import { getSendToAccounts } from '../../../ducks/metamask/metamask';
|
2021-02-04 19:15:23 +01:00
|
|
|
import SendFooter from './send-footer.component';
|
2018-04-26 18:38:38 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SendFooter);
|
2018-04-26 18:38:38 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
function mapStateToProps(state) {
|
2018-04-26 18:38:38 +02:00
|
|
|
return {
|
2021-06-23 23:35:25 +02:00
|
|
|
disabled: isSendFormInvalid(state),
|
2018-04-26 18:38:38 +02:00
|
|
|
to: getSendTo(state),
|
|
|
|
toAccounts: getSendToAccounts(state),
|
2021-09-17 06:37:50 +02:00
|
|
|
sendStage: getSendStage(state),
|
2019-03-05 16:45:01 +01:00
|
|
|
sendErrors: getSendErrors(state),
|
2021-09-17 06:37:50 +02:00
|
|
|
draftTransactionID: getDraftTransactionID(state),
|
2020-06-01 19:54:32 +02:00
|
|
|
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-04-26 18:38:38 +02:00
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
function mapDispatchToProps(dispatch) {
|
2018-04-26 18:38:38 +02:00
|
|
|
return {
|
2021-06-23 23:35:25 +02:00
|
|
|
resetSendState: () => dispatch(resetSendState()),
|
2021-09-17 06:37:50 +02:00
|
|
|
cancelTx: (t) => dispatch(cancelTx(t)),
|
2021-06-23 23:35:25 +02:00
|
|
|
sign: () => dispatch(signTransaction()),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-04-26 18:38:38 +02:00
|
|
|
}
|