Renamed setApproveForAllArg variable to be isApprovalOrRejection (#16012)

feature/default_network_editable
Filip Sekulic 2 years ago committed by GitHub
parent 393088e669
commit 76af0f4d4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      ui/components/app/confirm-page-container/confirm-page-container.component.js
  2. 17
      ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js
  3. 6
      ui/pages/confirm-approve/confirm-approve.js
  4. 6
      ui/pages/confirm-transaction-base/confirm-transaction-base.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 {
<ErrorMessage errorKey={errorKey} />
</div>
)}
{isSetApproveForAll && setApproveForAllArg && (
{isSetApproveForAll && isApprovalOrRejection && (
<Dialog type="error" className="confirm-page-container__dialog">
{/*
TODO: https://github.com/MetaMask/metamask-extension/issues/15745

@ -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 (
<div className="flex-column">
<div className="confirm-approve-content__small-text">
@ -315,9 +315,9 @@ export default class ConfirmApproveContent extends Component {
? t('functionSetApprovalForAll')
: t('functionApprove')}
</div>
{isSetApproveForAll && setApproveForAllArg !== undefined ? (
{isSetApproveForAll && isApprovalOrRejection !== undefined ? (
<div className="confirm-approve-content__small-text">
{`${t('parameters')}: ${setApproveForAllArg}`}
{`${t('parameters')}: ${isApprovalOrRejection}`}
</div>
) : null}
<div className="confirm-approve-content__small-text confirm-approve-content__data__data-block">
@ -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(),

@ -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 ? (
<Loading />
@ -170,13 +170,13 @@ export default function ConfirmApprove({
customTokenAmount={String(customPermissionAmount)}
dappProposedTokenAmount={tokenAmount}
currentTokenBalance={tokenBalance}
setApproveForAllArg={setApproveForAllArg}
isApprovalOrRejection={isApprovalOrRejection}
contentComponent={
<TransactionModalContextProvider>
<ConfirmApproveContent
userAddress={userAddress}
isSetApproveForAll={isSetApproveForAll}
setApproveForAllArg={setApproveForAllArg}
isApprovalOrRejection={isApprovalOrRejection}
decimals={decimals}
siteImage={siteImage}
setCustomAmount={setCustomPermissionAmount}

@ -161,7 +161,7 @@ export default class ConfirmTransactionBase extends Component {
eip1559V2Enabled: PropTypes.bool,
showBuyModal: PropTypes.func,
isBuyableChain: PropTypes.bool,
setApproveForAllArg: PropTypes.bool,
isApprovalOrRejection: PropTypes.bool,
///: BEGIN:ONLY_INCLUDE_IN(flask)
insightSnaps: PropTypes.arrayOf(PropTypes.object),
///: END:ONLY_INCLUDE_IN
@ -1127,7 +1127,7 @@ export default class ConfirmTransactionBase extends Component {
nativeCurrency,
hardwareWalletRequiresConnection,
image,
setApproveForAllArg,
isApprovalOrRejection,
assetStandard,
} = this.props;
const {
@ -1232,7 +1232,7 @@ export default class ConfirmTransactionBase extends Component {
currentTransaction={txData}
supportsEIP1559V2={this.supportsEIP1559V2}
nativeCurrency={nativeCurrency}
setApproveForAllArg={setApproveForAllArg}
isApprovalOrRejection={isApprovalOrRejection}
assetStandard={assetStandard}
/>
</TransactionModalContextProvider>

Loading…
Cancel
Save