Skip to content

Ensure correct primary currency image is displayed on home screen and token list#10777

Merged
darkwing merged 8 commits intoMetaMask:developfrom
darkwing:use-primary-token-image
Apr 1, 2021
Merged

Ensure correct primary currency image is displayed on home screen and token list#10777
darkwing merged 8 commits intoMetaMask:developfrom
darkwing:use-primary-token-image

Conversation

@darkwing
Copy link
Contributor

Explanation:

When on Binance Smart Chain, it's a bit jarring to see ETH as the default token image in the home header and token listing. This PR aims to fix that.

PrimaryIcon.mp4

@darkwing darkwing requested a review from a team as a code owner March 30, 2021 22:42
@darkwing darkwing requested review from NiranjanaBinoy and danjm and removed request for NiranjanaBinoy March 30, 2021 22:42
@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.

@darkwing darkwing force-pushed the use-primary-token-image branch from 0967454 to 89a4503 Compare March 31, 2021 15:45
Copy link
Member

Choose a reason for hiding this comment

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

Passing in the native currency as the "address" seems wrong 🤔 I see that we were already doing this for non-ETH native currencies though, for some reason 😕

Copy link
Contributor

Choose a reason for hiding this comment

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

The effect of this, and perhaps this was the intent, is to have a jazzicon display when there is a custom symbol for the custom network. Like this:
Screenshot from 2021-03-31 20-26-23

If no symbol is provided, it looks like this.

Screenshot from 2021-03-31 20-27-00

I agree that we should not do this, and instead should just show the new default of Identicon: <div style={getStyles(diameter)}></div>;

Now, the only problem with changing this is if some users have become acustomed to seeing the jazzicon for their particular custom network... so I think it'd be best not to break that in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

Yeesh. So we're treating this as an address without validating that it's even remotely similar to an address. That's unfortunate.

Reminds me of this bug: #8252.

Leaving this alone for this PR seems sensible to me. I'm not sure we should be concerned about users being accustomed to this icon though. It seems very broken and confusing to me. Particularly because we use jazzicons for people, and we don't want tokens mistaken for people. Maybe we can discuss it in a future standup.

@darkwing darkwing force-pushed the use-primary-token-image branch 2 times, most recently from 9238f31 to 7251d39 Compare April 1, 2021 16:57
@darkwing darkwing marked this pull request as draft April 1, 2021 19:36
@darkwing darkwing force-pushed the use-primary-token-image branch from d293999 to 5e2ddab Compare April 1, 2021 20:24
@darkwing darkwing marked this pull request as ready for review April 1, 2021 20:35
@darkwing darkwing force-pushed the use-primary-token-image branch from f146afc to f21361d Compare April 1, 2021 22:06
@darkwing darkwing force-pushed the use-primary-token-image branch from f21361d to 6cadd36 Compare April 1, 2021 22:37
Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@darkwing darkwing merged commit b2f6aa9 into MetaMask:develop Apr 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2021
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.

3 participants