Skip to content

Conversation

@kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Oct 22, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces a feature to customize the display order of asset tabs in the ConnectButton component, allowing users to prioritize "NFTs" or "Tokens". It also includes updates to related components and documentation.

Detailed summary

  • Added support for customizable asset tab order in ConnectButton.
  • Updated ViewAssets to dynamically set active tab based on assetTabs prop.
  • Enhanced documentation with instructions for tab customization.
  • Modified DetailsModal to hide the "View Funds" button if assetTabs is an empty array.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@vercel
Copy link

vercel bot commented Oct 22, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 6:36pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 6:36pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 6:36pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 6:36pm

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2024

🦋 Changeset detected

Latest commit: c621c13

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
thirdweb Minor

Not sure what this means? Click here to learn what changesets are.

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 22, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @kien-ngo and the rest of your teammates on Graphite Graphite

@github-actions
Copy link
Contributor

github-actions bot commented Oct 22, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 3.1 s (-4.84% 🔽) 4 s
thirdweb (cjs) 102.91 KB (0%) 2.1 s (0%) 5.1 s (-0.04% 🔽) 7.2 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 189 ms (-53.95% 🔽) 285 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 91 ms (+141.48% 🔺) 101 ms
thirdweb/react (minimal + tree-shaking) 16.98 KB (0%) 340 ms (0%) 339 ms (-3.32% 🔽) 678 ms

@codecov
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 28.84615% with 37 lines in your changes missing coverage. Please review.

Project coverage is 45.37%. Comparing base (004cac0) to head (c621c13).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../react/web/ui/ConnectWallet/screens/ViewAssets.tsx 44.11% 19 Missing ⚠️
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 0.00% 18 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5126   +/-   ##
=======================================
  Coverage   45.36%   45.37%           
=======================================
  Files        1067     1067           
  Lines       55433    55450   +17     
  Branches     3991     3991           
=======================================
+ Hits        25148    25161   +13     
- Misses      29594    29598    +4     
  Partials      691      691           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 004cac0
packages 40.41% <28.84%> (+0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...b/src/react/web/ui/ConnectWallet/ConnectButton.tsx 49.00% <ø> (ø)
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 1.09% <0.00%> (-0.01%) ⬇️
.../react/web/ui/ConnectWallet/screens/ViewAssets.tsx 19.75% <44.11%> (+16.81%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@gregfromstl gregfromstl left a comment

Choose a reason for hiding this comment

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

I don't think we should make this change. It's incredibly niche and if they want this level of customization they should probably be building their own UI. It'll also break as soon as we add another tab to this screen.

Copy link
Contributor Author

We were having a discussion here: https://linear.app/thirdweb/issue/CNCT-2036/feedbackfeature-request-on-nfts-tab
Joaquim thought it would be a good idea to add this feature

@gregfromstl
Copy link
Contributor

We were having a discussion here: https://linear.app/thirdweb/issue/CNCT-2036/feedbackfeature-request-on-nfts-tab Joaquim thought it would be a good idea to add this feature

Okay I guess I'm overruled then

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Nov 1, 2024
Copy link
Contributor

gregfromstl commented Nov 1, 2024

Merge activity

  • Nov 1, 2:06 PM EDT: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Nov 1, 2:06 PM EDT: A user added this pull request to the Graphite merge queue.
  • Nov 1, 2:36 PM EDT: A user merged this pull request with the Graphite merge queue.

gregfromstl pushed a commit that referenced this pull request Nov 1, 2024
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the `ConnectButton` component by allowing customization of the asset tab display order in the "View Assets" section. Users can now specify whether to show the "Tokens" or "NFTs" tab first, and an empty array will hide the "View Funds" button.

### Detailed summary
- Added `assetTabs` prop to `ConnectButton` for customizing asset tab order.
- Updated `ViewAssets` to dynamically render tabs based on `assetTabs` prop.
- Modified `DetailsModal` to conditionally display "View Funds" button based on `assetTabs` length.
- Enhanced documentation with instructions for using the new feature.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@gregfromstl gregfromstl force-pushed the kien/cnct-2036_view-funds-tabs branch from 8b87882 to dd8c382 Compare November 1, 2024 18:13
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces the ability to customize the display order of asset tabs in the `ConnectButton` component, allowing users to prioritize "NFTs" over "Tokens". It also includes updates to the documentation and type definitions to support this feature.

### Detailed summary
- Added customization for asset tab order in `ConnectButton`.
- Default order shows "Tokens" first; can be changed to `["nft", "token"]`.
- Updated type definitions to include `assetTabs` in `ConnectButtonProps`.
- Modified `ViewAssets` to dynamically render tabs based on `assetTabs`.
- Documentation updated to reflect changes in tab customization.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Adds the pull request to Graphite's merge queue. packages Playground Changes involving the Playground codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants