Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Make use of the new "label" property in the TokenDetails #1514

Closed
anxolin opened this issue Oct 8, 2020 · 0 comments
Closed

Make use of the new "label" property in the TokenDetails #1514

anxolin opened this issue Oct 8, 2020 · 0 comments
Labels
wontfix This will not be worked on

Comments

@anxolin
Copy link
Contributor

anxolin commented Oct 8, 2020

Intro to the issue:

  • The token symbols are displayed in many parts of the app
  • Normally, the token is modeled as a TokenDetail which has all the info from the ERC20 token plus some additions (like ID, or if the token is deprecated)
  • Not all the tokens have symbol, this is inherited from the ERC20 standard
  • To be able to always display a label for every token, even if it doesn't have a symbol, we make use of safeTokenName wich has some fallback options to always return a string
  • The token list is cached, so once we construct this detailed representation of a Token, we don't recreate it over and over
  • Every time we debug tokens, or display tokens we are handing the case where the symbol is undefined or we use the safeTokenName over and over

Now, this PR: https://github.com/gnosis/dex-react/pull/1513/files

  • Added a mandatory label to the TokenDetails, just for convenience (for the problem above)
  • In the PR was used only for sorting the tokens Alphabetically

Now we get to the point where I can explain what this issue is about :)

Let's make use of the label in the app, so we don't habdle "over and over" the same logic for displaying tokens. 😀

@anxolin anxolin changed the title Make use of the label Make use of the new "label" property in the TokenDetails Oct 8, 2020
@alfetopito alfetopito added the wontfix This will not be worked on label Jan 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants