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: Token Picker component #1683

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

Conversation

mykcryptodev
Copy link
Contributor

@mykcryptodev mykcryptodev commented Nov 28, 2024

What changed? Why?
Add a component that composes the , and to give builders an easy way for users to pop a modal for finding and selecting a token

Notes to reviewers
This PR also adds the Token Picker to the playground. I noticed other Token components are not there so I am happy to remove if desired.

The token picker modal allows you to focus, scroll and select tokens with your keyboard.

To test this locally you may have to add this to the TokenPicker for search to work

import { setOnchainKitConfig } from '../../OnchainKitConfig';
import { base } from 'viem/chains';

export function TokenPicker({
  pickedToken,
  onTokenPicked,
  defaultTokens,
  className,
  onError,
}: TokenPickerProps) {
setOnchainKitConfig({
    apiKey: "YOUR_KEY",
    chain: base,
  });
  ...

How has it been tested?
Added unit tests and tested in local playground

tokenpicker.mov

Copy link

vercel bot commented Nov 28, 2024

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

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ❌ Failed (Inspect) Nov 28, 2024 3:50pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2024 3:50pm

Copy link

vercel bot commented Nov 28, 2024

Someone is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@fakepixels
Copy link
Contributor

This looks so great! Thank you so much for the contribution.

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

Successfully merging this pull request may close these issues.

2 participants