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

feat: new token selection modal #711

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

Conversation

0xAlunara
Copy link
Collaborator

@0xAlunara 0xAlunara commented Feb 26, 2025

Various:

  • Fixes incorrect border colors for clickable chips
  • Implements correct colors for dividers
  • Removes outlines on focused lists (was a black border around the entire list)
  • Fixes card headers being vertically aligned to the bottom

Main:

  • Adds new token select feature
  • Adds stories for the new token select feature
  • Removes old token select code and replaces it with the new one

Highlights:

  • User search is debounced for performance
  • Tried Tanstack Virtual, but had to abandon due to glitchy behaviour and even worse performance than native. The good thing is, the token icons are loaded lazily even in native React, which means they won't be loaded until the users scrolls it into view
  • Adds support for token favorites. A good example use case is when creating a pool and selected a token, two tokens can be considered favorite.
  • Token list is sorted first by user dollar balance, putting anything with a dollar value on top. If one has no usd value, it switches to ordering by token balance. Lastly, if that also doesn't work, it switches to ordering by token symbol
  • I've added the 'hide small pools' settings to the user profile, because it makes sense to me that it's a global setting across different pages.
  • The token selector can be disabled
  • Specific tokens in the list can be disabled (perhaps due to blacklisting because of a hack)
  • You can pass a custom settings component to the selector in case you want to add extra settings between the list and the favorite chips yourself.

I've refrained from refactoring old code as much as possible, which means that the initial fetching of the token list is still slow as hell. I don't want to inflate the PR with even more code changes than it already has.

Copy link

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
curve-dapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 10:36pm
curve-dapp-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 10:36pm

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.

2 participants