Skip to content

fix(frontend): Token group with disabled native token network should not display CK icon name and symbol #5795

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

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

daviddecentage
Copy link
Collaborator

@daviddecentage daviddecentage commented Apr 10, 2025

Motivation

When we disable the network for the native token of a token group, but there still is another token that gets grouped with the CK token, the icon, name and symbol of the group shows the CK tokens data which isnt correct.

Changes

  • Introduces token groups, with a groupData prop on the tokens. This will decide what group icon, name and symbol will be displayed when the token forms a group in the homepage token list. In the future we could also use this to define how groups should be formed instead of figuring it out based on token data as it is now.
  • Refactored all tokens to include the group
  • Used main token group for ck tokens
  • Adjusted TokenCard and TokenCardGroup to now display the groupData info when rendering the TokenCard with prop asGroup
  • Added groupData prop to schemas for Token and IcCkInterface

Tests

Before:
image

After:
image

@daviddecentage daviddecentage requested a review from a team as a code owner April 10, 2025 15:33
Copy link
Collaborator

@AntonioVentilii AntonioVentilii left a comment

Choose a reason for hiding this comment

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

For the future development (including more networks) and to have a global solution, I suggest that we tackle this issue in a different way. Let's create a common prop inside Token (or maybe TokenUI) type

groupingData: {
  symbol,
  icon,
  name
}

so, we create base grouping data objects (like USDC, ETH, or similars) and add it to all the existing tokens where required. So, when we group, instead of using twinTokens for ICRC, and other props for the rest, we use this directly for all tokens (if present).

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants