diff --git a/ui/app/pages/confirm-approve/confirm-approve.component.js b/ui/app/pages/confirm-approve/confirm-approve.component.js index 7a08ffebe751..58c5dc706c68 100644 --- a/ui/app/pages/confirm-approve/confirm-approve.component.js +++ b/ui/app/pages/confirm-approve/confirm-approve.component.js @@ -85,44 +85,38 @@ export default class ConfirmApprove extends Component { : '' } + const customData = customPermissionAmount + ? getCustomTxParamsData(data, { customPermissionAmount, tokenAmount, decimals }) + : null + return ( { - this.setState({ customPermissionAmount: newAmount }) - }} - customTokenAmount={String(customPermissionAmount)} - tokenAmount={String(tokenAmount)} - origin={origin} - tokenSymbol={tokenSymbol} - tokenBalance={tokenBalance} - showCustomizeGasModal={() => showCustomizeGasModal(txData)} - showEditApprovalPermissionModal={showEditApprovalPermissionModal} - data={data} - toAddress={toAddress} - currentCurrency={currentCurrency} - ethTransactionTotal={ethTransactionTotal} - fiatTransactionTotal={fiatTransactionTotal} - /> - ) - } + contentComponent={( + { + this.setState({ customPermissionAmount: newAmount }) + }} + customTokenAmount={String(customPermissionAmount)} + tokenAmount={String(tokenAmount)} + origin={origin} + tokenSymbol={tokenSymbol} + tokenBalance={tokenBalance} + showCustomizeGasModal={() => showCustomizeGasModal(txData)} + showEditApprovalPermissionModal={showEditApprovalPermissionModal} + data={customData || data} + toAddress={toAddress} + currentCurrency={currentCurrency} + ethTransactionTotal={ethTransactionTotal} + fiatTransactionTotal={fiatTransactionTotal} + /> + )} hideSenderToRecipient - customTxParamsData={ - customPermissionAmount - ? getCustomTxParamsData(data, { - customPermissionAmount, - tokenAmount, - decimals, - }) - : null - } + customTxParamsData={customData} {...restProps} /> )