Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust 'Confirm' button color on setApprovalForAll revocations #17506

Merged
merged 2 commits into from Feb 1, 2023

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Jan 31, 2023

Fixes: #17466

Before

Screenshot 2023-01-27 at 12 55 23

After

Screen Shot 2023-01-31 at 3 33 51 AM

Screen Shot 2023-01-31 at 3 34 11 AM

Manual Testing Steps

  1. Go to https://etherscan.io/address/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d#writeContract
  2. Connect your wallet
  3. Go to setApprovalForAll
  4. Input any address and false for the approved(bool) parameter
  5. Click write
  6. Ensure the confirm button shows up as blue

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@@ -277,7 +277,11 @@ const ConfirmPageContainer = (props) => {
: onSubmit
}
submitText={t('confirm')}
submitButtonType={isSetApproveForAll ? 'danger-primary' : 'primary'}
submitButtonType={
isSetApproveForAll && isApprovalOrRejection
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: isApprovalOrRejection is true when it is an approval transaction, and false when it's a revocation. The naming of the variable seems to imply it is true in both cases. It could likely be named better.

@metamaskbot
Copy link
Collaborator

Builds ready [7d304bf]
Page Load Metrics (1360 ± 98 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint98162128189
domContentLoaded103716761338217104
load10561676136020598
domInteractive103716761338217104
Bundle size diffs
  • background: 0 bytes
  • ui: 4 bytes
  • common: 0 bytes

Copy link
Contributor

@NiranjanaBinoy NiranjanaBinoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ryanml ryanml merged commit 5e863a2 into develop Feb 1, 2023
@ryanml ryanml deleted the fix-17466 branch February 1, 2023 01:22
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Confirm button when revoking setApprovalForAll should not be red
4 participants