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

Replaced ActionableMessage and Deprecated Button #20443

Conversation

pritam1813
Copy link
Contributor

@pritam1813 pritam1813 commented Aug 14, 2023

Explanation

Screenshots/Screencaps

Before

Token With Same Symbol But Different Address (Before)
token-with-same-symbol-but-different-address_Before

Token With Duplicate Contract Address (Before)
Same-address-different-symbol_Before

After

Token With Same Symbol But Different Address (After)
after_with_diff_addrs

Token With Duplicate Contract Address (After)
after_with_same_address

Manual Testing Steps

  1. Create and Install the new build with this PR.
  2. Visit and Connect the Wallet on Test Dapp Site .
  3. Input token address, symbol and decimal under EIP 747 section and click Add Token.
  4. Test with a token that is already added to the wallet.
    • Input same address but different token name.
    • Input different contract address and same token name.

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.

@pritam1813 pritam1813 requested a review from a team as a code owner August 14, 2023 06:29
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a3085c1) 68.82% compared to head (00fd1a3) 68.81%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20443      +/-   ##
===========================================
- Coverage    68.82%   68.81%   -0.00%     
===========================================
  Files         1034     1034              
  Lines        41166    41166              
  Branches     10994    10994              
===========================================
- Hits         28329    28327       -2     
- Misses       12837    12839       +2     
Files Coverage Δ
...add-suggested-token/confirm-add-suggested-token.js 98.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Hey @pritam1813, great start I've left a couple suggestions.

<Button
type="link"
variant={BUTTON_VARIANT.LINK}
key="confirm-add-suggested-token-duplicate-warning"
className="confirm-add-suggested-token__link"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this class and removed the associated styles

  &__link {
    @include H7;

    display: inline;
    color: var(--color-primary-default);
    padding-left: 0;
  }

from ui/pages/confirm-add-suggested-token/index.scss

We want the link here to be the same size as the body text

Screenshot 2023-08-28 at 5 02 58 PM

import ActionableMessage from '../../components/ui/actionable-message/actionable-message';
import Button from '../../components/ui/button';
import {
BUTTON_VARIANT,
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe BUTTON_VARIANT has now been deprecated in favor of the ButtonVariant enum. Could you please replace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, replaced the enum.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, I am facing this bug #19818, as a result I couldn't update the screenshot. Any suggestion on how to avoid this bug ? I am on Ubuntu.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @kumavis, would it be possible to support @pritam1813 on his lavamoat issue?

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

This is looking great @pritam1813! Made a small suggestion to add some margins so it adds some space between the text and banner alert

return (
hasDuplicateAddress(suggestedTokens, tokens) && (
<ActionableMessage
message={t('knownTokenWarning', [
<BannerAlert severity={Severity.Warning}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a margin top here

Suggested change
<BannerAlert severity={Severity.Warning}>
<BannerAlert severity={Severity.Warning} marginTop={4}>

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for your contribution @pritam1813

  • pulled branch and tested locally
    Screenshot 2023-10-18 at 4 05 37 PMScreenshot 2023-10-18 at 4 07 08 PM

@garrettbear garrettbear merged commit 22174a1 into MetaMask:develop Jan 24, 2024
67 of 68 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants