From 76af0f4d4fe99d1c8ee068541c99232ce401edcf Mon Sep 17 00:00:00 2001 From: Filip Sekulic Date: Tue, 4 Oct 2022 20:37:11 +0200 Subject: [PATCH] Renamed setApproveForAllArg variable to be isApprovalOrRejection (#16012) --- .../confirm-page-container.component.js | 6 +++--- .../confirm-approve-content.component.js | 17 +++++++++-------- ui/pages/confirm-approve/confirm-approve.js | 6 +++--- .../confirm-transaction-base.component.js | 6 +++--- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/ui/components/app/confirm-page-container/confirm-page-container.component.js b/ui/components/app/confirm-page-container/confirm-page-container.component.js index 35905c940..edb124001 100644 --- a/ui/components/app/confirm-page-container/confirm-page-container.component.js +++ b/ui/components/app/confirm-page-container/confirm-page-container.component.js @@ -108,7 +108,7 @@ export default class ConfirmPageContainer extends Component { nativeCurrency: PropTypes.string, showBuyModal: PropTypes.func, isBuyableChain: PropTypes.bool, - setApproveForAllArg: PropTypes.bool, + isApprovalOrRejection: PropTypes.bool, }; render() { @@ -165,7 +165,7 @@ export default class ConfirmPageContainer extends Component { showBuyModal, isBuyableChain, networkIdentifier, - setApproveForAllArg, + isApprovalOrRejection, ///: BEGIN:ONLY_INCLUDE_IN(flask) insightComponent, ///: END:ONLY_INCLUDE_IN @@ -339,7 +339,7 @@ export default class ConfirmPageContainer extends Component { )} - {isSetApproveForAll && setApproveForAllArg && ( + {isSetApproveForAll && isApprovalOrRejection && ( {/* TODO: https://github.com/MetaMask/metamask-extension/issues/15745 diff --git a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js index 265920391..859d8a7ad 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js +++ b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js @@ -75,7 +75,7 @@ export default class ConfirmApproveContent extends Component { tokenId: PropTypes.string, assetStandard: PropTypes.string, isSetApproveForAll: PropTypes.bool, - setApproveForAllArg: PropTypes.bool, + isApprovalOrRejection: PropTypes.bool, userAddress: PropTypes.string, }; @@ -307,7 +307,7 @@ export default class ConfirmApproveContent extends Component { renderDataContent() { const { t } = this.context; - const { data, isSetApproveForAll, setApproveForAllArg } = this.props; + const { data, isSetApproveForAll, isApprovalOrRejection } = this.props; return (
@@ -315,9 +315,9 @@ export default class ConfirmApproveContent extends Component { ? t('functionSetApprovalForAll') : t('functionApprove')}
- {isSetApproveForAll && setApproveForAllArg !== undefined ? ( + {isSetApproveForAll && isApprovalOrRejection !== undefined ? (
- {`${t('parameters')}: ${setApproveForAllArg}`} + {`${t('parameters')}: ${isApprovalOrRejection}`}
) : null}
@@ -531,14 +531,14 @@ export default class ConfirmApproveContent extends Component { renderTitle() { const { t } = this.context; - const { isSetApproveForAll, setApproveForAllArg } = this.props; + const { isSetApproveForAll, isApprovalOrRejection } = this.props; const titleTokenDescription = this.getTitleTokenDescription(); let title; if (isSetApproveForAll) { title = t('approveAllTokensTitle', [titleTokenDescription]); - if (setApproveForAllArg === false) { + if (isApprovalOrRejection === false) { title = t('revokeAllTokensTitle', [titleTokenDescription]); } } @@ -547,14 +547,15 @@ export default class ConfirmApproveContent extends Component { renderDescription() { const { t } = this.context; - const { isContract, isSetApproveForAll, setApproveForAllArg } = this.props; + const { isContract, isSetApproveForAll, isApprovalOrRejection } = + this.props; const grantee = isContract ? t('contract').toLowerCase() : t('account').toLowerCase(); let description = t('trustSiteApprovePermission', [grantee]); - if (isSetApproveForAll && setApproveForAllArg === false) { + if (isSetApproveForAll && isApprovalOrRejection === false) { description = t('revokeApproveForAllDescription', [ grantee, this.getTitleTokenDescription(), diff --git a/ui/pages/confirm-approve/confirm-approve.js b/ui/pages/confirm-approve/confirm-approve.js index d785d473d..5af747801 100644 --- a/ui/pages/confirm-approve/confirm-approve.js +++ b/ui/pages/confirm-approve/confirm-approve.js @@ -155,7 +155,7 @@ export default function ConfirmApprove({ const parsedTransactionData = parseStandardTokenTransactionData(transactionData); - const setApproveForAllArg = getTokenApprovedParam(parsedTransactionData); + const isApprovalOrRejection = getTokenApprovedParam(parsedTransactionData); return tokenSymbol === undefined && assetName === undefined ? ( @@ -170,13 +170,13 @@ export default function ConfirmApprove({ customTokenAmount={String(customPermissionAmount)} dappProposedTokenAmount={tokenAmount} currentTokenBalance={tokenBalance} - setApproveForAllArg={setApproveForAllArg} + isApprovalOrRejection={isApprovalOrRejection} contentComponent={