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

[SDK] Add onClose callback to details modal #5605

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Dec 4, 2024

CNCT-2444
CNCT-2444


PR-Codex overview

This PR focuses on enhancing the ConnectButton component by adding an onClose callback for the details modal, improving functionality and user experience. It also includes various updates to the ChainIcon, NetworkSwitcherButton, and related components.

Detailed summary

  • Added onClose callback to ConnectButtonProps for modal closure.
  • Updated ConnectButton documentation to include usage of onClose.
  • Enhanced NetworkSwitcherButton to utilize the new onClose callback.
  • Improved test coverage for NetworkSwitcherButton and related components.
  • Refactored ChainIcon and fetchChainIcon for better icon resolution.
  • Added internal documentation for several components.
  • Fixed issues related to rendering chain icons and fallback images.

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

Copy link

vercel bot commented Dec 4, 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 Dec 26, 2024 3:10am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 26, 2024 3:10am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 26, 2024 3:10am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 26, 2024 3:10am

Copy link

changeset-bot bot commented Dec 4, 2024

🦋 Changeset detected

Latest commit: e9c23ad

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

This PR includes changesets to release 2 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch

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

Copy link

graphite-app bot commented Dec 4, 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.

@kien-ngo kien-ngo marked this pull request as ready for review December 4, 2024 11:07
Copy link
Contributor Author

kien-ngo commented Dec 4, 2024


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

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

Copy link
Contributor

github-actions bot commented Dec 4, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.02 KB (0%) 901 ms (0%) 3.7 s (+11.06% 🔺) 4.6 s
thirdweb (cjs) 110.76 KB (0%) 2.3 s (0%) 7.4 s (+13.16% 🔺) 9.6 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 393 ms (-24.35% 🔽) 505 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 81 ms (-70.03% 🔽) 91 ms
thirdweb/react (minimal + tree-shaking) 19.12 KB (0%) 383 ms (0%) 699 ms (+2.44% 🔺) 1.1 s

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 89.35361% with 28 lines in your changes missing coverage. Please review.

Project coverage is 54.53%. Comparing base (ce3e850) to head (e9c23ad).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 75.65% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5605      +/-   ##
==========================================
+ Coverage   54.12%   54.53%   +0.40%     
==========================================
  Files        1102     1105       +3     
  Lines       59206    59332     +126     
  Branches     4886     4924      +38     
==========================================
+ Hits        32044    32354     +310     
+ Misses      26438    26258     -180     
+ Partials      724      720       -4     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from ce3e850
packages 52.02% <89.35%> (+0.50%) ⬆️

*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.01% <ø> (ø)
...src/react/web/ui/ConnectWallet/NetworkSelector.tsx 33.56% <100.00%> (+29.40%) ⬆️
...web/src/react/web/ui/components/ChainActiveDot.tsx 100.00% <100.00%> (ø)
...thirdweb/src/react/web/ui/components/ChainIcon.tsx 100.00% <100.00%> (+68.08%) ⬆️
...b/src/react/web/ui/components/fallbackChainIcon.ts 100.00% <100.00%> (ø)
.../thirdweb/src/react/web/ui/prebuilt/Chain/icon.tsx 96.61% <100.00%> (ø)
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 56.33% <75.65%> (+2.47%) ⬆️

... and 6 files with indirect coverage changes

Copy link
Member

@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.

LGTM but I'm a little confused how this solves the original issue, also why we need the screen param to be passed to onClose (feels like something a little too internal to be exposing). I trust though

CNCT-2444
CNCT-2444

<!-- start pr-codex -->

---

## PR-Codex overview
This PR primarily introduces an `onClose` callback for the `ConnectButton` component's details modal, enhancing its functionality. It also improves the rendering of various components and adds tests for new features.

### Detailed summary
- Added `onClose` callback to `ConnectButtonProps` for modal closure.
- Updated `ConnectButton` to utilize the `onClose` callback.
- Improved test coverage for `NetworkSwitcherButton` and `ChainIcon`.
- Enhanced `fetchChainIcon` functionality to handle various icon resolvers.
- Introduced `ChainActiveDot` for visual representation of active chains.
- Updated `NetworkSelector` and `DetailsModal` components for better user experience.

> ✨ 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
Dashboard Involves changes to the Dashboard. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants