mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
remove unnecessary usage of renderableGasButton logic (#15422)
This commit is contained in:
parent
4c4ce83b0b
commit
109e46c95f
@ -20,7 +20,6 @@ export default class SendFooter extends Component {
|
|||||||
toAccounts: PropTypes.array,
|
toAccounts: PropTypes.array,
|
||||||
sendStage: PropTypes.string,
|
sendStage: PropTypes.string,
|
||||||
sendErrors: PropTypes.object,
|
sendErrors: PropTypes.object,
|
||||||
gasEstimateType: PropTypes.string,
|
|
||||||
mostRecentOverviewPage: PropTypes.string.isRequired,
|
mostRecentOverviewPage: PropTypes.string.isRequired,
|
||||||
cancelTx: PropTypes.func,
|
cancelTx: PropTypes.func,
|
||||||
draftTransactionID: PropTypes.string,
|
draftTransactionID: PropTypes.string,
|
||||||
@ -53,14 +52,7 @@ export default class SendFooter extends Component {
|
|||||||
|
|
||||||
async onSubmit(event) {
|
async onSubmit(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const {
|
const { addToAddressBookIfNew, sign, to, toAccounts, history } = this.props;
|
||||||
addToAddressBookIfNew,
|
|
||||||
sign,
|
|
||||||
to,
|
|
||||||
toAccounts,
|
|
||||||
history,
|
|
||||||
gasEstimateType,
|
|
||||||
} = this.props;
|
|
||||||
const { trackEvent } = this.context;
|
const { trackEvent } = this.context;
|
||||||
|
|
||||||
// TODO: add nickname functionality
|
// TODO: add nickname functionality
|
||||||
@ -74,7 +66,6 @@ export default class SendFooter extends Component {
|
|||||||
properties: {
|
properties: {
|
||||||
action: 'Edit Screen',
|
action: 'Edit Screen',
|
||||||
legacy_event: true,
|
legacy_event: true,
|
||||||
gasChanged: gasEstimateType,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
history.push(CONFIRM_TRANSACTION_ROUTE);
|
history.push(CONFIRM_TRANSACTION_ROUTE);
|
||||||
|
|||||||
@ -1,12 +1,7 @@
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { addToAddressBook, cancelTx } from '../../../store/actions';
|
import { addToAddressBook, cancelTx } from '../../../store/actions';
|
||||||
import {
|
|
||||||
getRenderableEstimateDataForSmallButtonsFromGWEI,
|
|
||||||
getDefaultActiveButtonIndex,
|
|
||||||
} from '../../../selectors';
|
|
||||||
import {
|
import {
|
||||||
resetSendState,
|
resetSendState,
|
||||||
getGasPrice,
|
|
||||||
getSendStage,
|
getSendStage,
|
||||||
getSendTo,
|
getSendTo,
|
||||||
getSendErrors,
|
getSendErrors,
|
||||||
@ -17,7 +12,6 @@ import {
|
|||||||
import { getMostRecentOverviewPage } from '../../../ducks/history/history';
|
import { getMostRecentOverviewPage } from '../../../ducks/history/history';
|
||||||
import { addHexPrefix } from '../../../../app/scripts/lib/util';
|
import { addHexPrefix } from '../../../../app/scripts/lib/util';
|
||||||
import { getSendToAccounts } from '../../../ducks/metamask/metamask';
|
import { getSendToAccounts } from '../../../ducks/metamask/metamask';
|
||||||
import { CUSTOM_GAS_ESTIMATE } from '../../../../shared/constants/gas';
|
|
||||||
import SendFooter from './send-footer.component';
|
import SendFooter from './send-footer.component';
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(SendFooter);
|
export default connect(mapStateToProps, mapDispatchToProps)(SendFooter);
|
||||||
@ -31,17 +25,6 @@ function addressIsNew(toAccounts, newAddress) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
const gasButtonInfo = getRenderableEstimateDataForSmallButtonsFromGWEI(state);
|
|
||||||
const gasPrice = getGasPrice(state);
|
|
||||||
const activeButtonIndex = getDefaultActiveButtonIndex(
|
|
||||||
gasButtonInfo,
|
|
||||||
gasPrice,
|
|
||||||
);
|
|
||||||
const gasEstimateType =
|
|
||||||
activeButtonIndex >= 0
|
|
||||||
? gasButtonInfo[activeButtonIndex].gasEstimateType
|
|
||||||
: CUSTOM_GAS_ESTIMATE;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
disabled: isSendFormInvalid(state),
|
disabled: isSendFormInvalid(state),
|
||||||
to: getSendTo(state),
|
to: getSendTo(state),
|
||||||
@ -49,7 +32,6 @@ function mapStateToProps(state) {
|
|||||||
sendStage: getSendStage(state),
|
sendStage: getSendStage(state),
|
||||||
sendErrors: getSendErrors(state),
|
sendErrors: getSendErrors(state),
|
||||||
draftTransactionID: getDraftTransactionID(state),
|
draftTransactionID: getDraftTransactionID(state),
|
||||||
gasEstimateType,
|
|
||||||
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user