js
js copied to clipboard
PayEmbed context cleanup, Add PayEmbedUI
PR-Codex overview
This PR enhances the wallet connection and chain switching functionalities in the codebase.
Detailed summary
- Added
switchChainfunction to components for seamless chain switching - Updated components to receive
activeChainandaccountprops - Refactored use of
useActiveWalletChainanduseActiveAccounthooks
The following files were skipped due to too many changes:
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/FiatDetailsScreen.tsx,packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx,packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/tx-history/BuyTxHistory.tsx,packages/thirdweb/src/react/web/ui/PayEmbed.tsx,packages/thirdweb/src/react/web/ui/PayEmbedUI.tsx,packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx,packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx,packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}
⚠️ No Changeset found
Latest commit: e55b6ba21dc50752555cb3c2192c3a5821e000ac
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
CodSpeed Performance Report
Merging #2998 will not alter performance
Comparing mnn/adapter-payembed (e55b6ba) with main (523cd1e)
Summary
✅ 9 untouched benchmarks
size-limit report 📦
| Path | Size | Loading time (3g) | Running time (snapdragon) | Total time |
|---|---|---|---|---|
| thirdweb (esm) | 39.07 KB (0%) | 782 ms (0%) | 508 ms (+57.28% 🔺) | 1.3 s |
| thirdweb (cjs) | 87.87 KB (0%) | 1.8 s (0%) | 1.8 s (+80.33% 🔺) | 3.5 s |
| thirdweb (minimal + tree-shaking) | 4.71 KB (0%) | 95 ms (0%) | 161 ms (+517.31% 🔺) | 255 ms |
| thirdweb/chains (tree-shaking) | 400 B (0%) | 10 ms (0%) | 60 ms (+776.89% 🔺) | 70 ms |
| thirdweb/react (minimal + tree-shaking) | 16.38 KB (0%) | 328 ms (0%) | 181 ms (+264.97% 🔺) | 509 ms |
Codecov Report
Attention: Patch coverage is 29.77099% with 92 lines in your changes are missing coverage. Please review.
Project coverage is 64.56%. Comparing base (
02c0319) to head (e55b6ba). Report is 7 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2998 +/- ##
==========================================
- Coverage 64.58% 64.56% -0.03%
==========================================
Files 758 758
Lines 52966 53057 +91
Branches 3092 3093 +1
==========================================
+ Hits 34208 34254 +46
- Misses 18093 18138 +45
Partials 665 665
| Flag | Coverage Δ | *Carryforward flag | |
|---|---|---|---|
| legacy_packages | 65.66% <ø> (ø) |
Carriedforward from 9d2df4d | |
| packages | 64.27% <29.77%> (-0.03%) |
:arrow_down: |
*This pull request uses carry forward flags. Click here to find out more.
| Files | Coverage Δ | |
|---|---|---|
| ...b/src/react/web/ui/ConnectWallet/ConnectButton.tsx | 58.95% <88.88%> (+0.76%) |
:arrow_up: |
| ...dweb/src/react/web/ui/components/SwitchNetwork.tsx | 16.21% <0.00%> (-2.21%) |
:arrow_down: |
| ...web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx | 24.34% <50.00%> (+1.41%) |
:arrow_up: |
| ...screens/Buy/tx-history/useBuyTransactionsToShow.ts | 14.35% <50.00%> (+0.67%) |
:arrow_up: |
| .../ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx | 12.76% <25.00%> (+0.26%) |
:arrow_up: |
| ...nectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx | 23.43% <25.00%> (+0.22%) |
:arrow_up: |
| ...allet/screens/Buy/tx-history/FiatDetailsScreen.tsx | 12.67% <25.00%> (+0.73%) |
:arrow_up: |
| ...tWallet/screens/Buy/tx-history/TxDetailsScreen.tsx | 16.66% <25.00%> (+1.66%) |
:arrow_up: |
| ...hirdweb/src/react/web/hooks/useSendTransaction.tsx | 40.18% <35.29%> (-0.34%) |
:arrow_down: |
| ...nectWallet/screens/Buy/tx-history/BuyTxHistory.tsx | 17.79% <22.22%> (-0.71%) |
:arrow_down: |
| ... and 2 more |
question: should we add a new component PayEmbedUI?
TODO: test this