Skip to content

✨ [issue-366] Add TokenBalance component #368

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

Merged
merged 1 commit into from
Aug 3, 2022
Merged

✨ [issue-366] Add TokenBalance component #368

merged 1 commit into from
Aug 3, 2022

Conversation

andriishupta
Copy link
Contributor

Closes #366

Description

  • add component / test / storybook
  • add examples to the playground
  • add connect button for testing

How it works

It follows the same props as wagmi's useBalance hook with one difference: addressOrName is optional, and if it is skipped - we will try to take address from connected account

Screenshots

Playground

  1. image
  2. image
  3. image

Storybook

  1. image
  2. image

Tests

image

@changeset-bot
Copy link

changeset-bot bot commented Aug 3, 2022

⚠️ No Changeset found

Latest commit: b9f39f5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 3, 2022

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

Name Status Preview Updated
web3-ui-docs ❌ Failed (Inspect) Aug 3, 2022 at 0:48AM (UTC)
web3ui ✅ Ready (Inspect) Visit Preview Aug 3, 2022 at 0:48AM (UTC)

@andriishupta
Copy link
Contributor Author

@e-roy please, review

I extended a little bit of default functionality to match useBalance hook
Also, I added connect button to test

Side-note: there were some https://nextjs.org/docs/messages/react-hydration-error Hydration errors because of Next.js SSR and that MetaMask turns on only on client side
As you may know - it is a common error for SSR and libraries who requires window

I fixed it manually with the mounted variable, but we can introduce Suspense and Lazy load in the Playground if needed.

- add component / test / storybook
- add examples to playground
- add connect button for testing
@andriishupta andriishupta changed the title ✨ [issue-366] Add TokenBalance component Draft: ✨ [issue-366] Add TokenBalance component Aug 3, 2022
@andriishupta andriishupta changed the title Draft: ✨ [issue-366] Add TokenBalance component ✨ [issue-366] Add TokenBalance component Aug 3, 2022
@andriishupta andriishupta marked this pull request as draft August 3, 2022 12:49
@andriishupta andriishupta marked this pull request as ready for review August 3, 2022 12:52
@andriishupta
Copy link
Contributor Author

ready for review - moved to draft and back to active cause did rebase

@e-roy e-roy merged commit 1bbc704 into Developer-DAO:main Aug 3, 2022
@e-roy
Copy link
Contributor

e-roy commented Aug 3, 2022

web3-ui-docs build isn't working unrelated to this. will create a issue for this. thanks!

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.

Token Balance component
2 participants