js icon indicating copy to clipboard operation
js copied to clipboard

[WIP] Add Buy with credit card UI

Open MananTank opened this issue 1 year ago • 6 comments

PR-Codex overview

This PR enables the "Credit Card" option in the Buy screen of ConnectButton.

Detailed summary

  • Added "Credit Card" option in Buy screen
  • Added useBuyWithFiatQuote and useBuyWithFiatStatus hooks
  • Updated currency icons and selection
  • Refactored fee components and endpoints

The following files were skipped due to too many changes: packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/Stepper.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/PaymentSelection.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/KadoScreen.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/icons/currencies/USDIcon.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/icons/currencies/GBPIcon.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.tsx, packages/thirdweb/src/pay/buyWithFiat/getQuote.ts, packages/thirdweb/src/pay/buyWithFiat/getStatus.ts, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatConfirmation.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/SwapScreen.tsx

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

MananTank avatar Apr 17 '24 19:04 MananTank

🦋 Changeset detected

Latest commit: 35adf7ad66bc2c29d3255e7c223e8584d1998f70

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

This PR includes changesets to release 10 packages
Name Type
@thirdweb-dev/react Patch
thirdweb Minor
@thirdweb-dev/sdk Patch
@thirdweb-dev/cli Patch
@thirdweb-dev/react-core Patch
@thirdweb-dev/react-native Patch
@thirdweb-dev/unity-js-bridge Patch
@thirdweb-dev/wallets Patch
@thirdweb-dev/auth Patch
@thirdweb-dev/react-native-compat 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

changeset-bot[bot] avatar Apr 17 '24 19:04 changeset-bot[bot]

CodSpeed Performance Report

Merging #2801 will not alter performance

Comparing mnn/buy-with-credit-card (35adf7a) with main (aad5f9f)

Summary

✅ 9 untouched benchmarks

codspeed-hq[bot] avatar Apr 17 '24 19:04 codspeed-hq[bot]

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 39.07 KB (+0.19% 🔺) 782 ms (+0.19% 🔺) 654 ms (+85.06% 🔺) 1.5 s
thirdweb (cjs) 87.91 KB (+0.17% 🔺) 1.8 s (+0.17% 🔺) 1.4 s (+10.01% 🔺) 3.2 s
thirdweb (minimal + tree-shaking) 4.71 KB (0%) 95 ms (0%) 37 ms (-1.85% 🔽) 131 ms
thirdweb/chains (tree-shaking) 400 B (0%) 10 ms (0%) 10 ms (-28.45% 🔽) 20 ms
thirdweb/react (minimal + tree-shaking) 16.38 KB (-0.05% 🔽) 328 ms (-0.05% 🔽) 89 ms (-45.02% 🔽) 417 ms

github-actions[bot] avatar Apr 17 '24 19:04 github-actions[bot]

Codecov Report

Attention: Patch coverage is 32.48369% with 3311 lines in your changes are missing coverage. Please review.

Project coverage is 64.54%. Comparing base (aad5f9f) to head (35adf7a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2801      +/-   ##
==========================================
- Coverage   65.12%   64.54%   -0.58%     
==========================================
  Files         744      772      +28     
  Lines       52049    54159    +2110     
  Branches     3091     3092       +1     
==========================================
+ Hits        33896    34957    +1061     
- Misses      17488    18536    +1048     
- Partials      665      666       +1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.65% <ø> (-0.01%) :arrow_down: Carriedforward from 0e4391e
packages 64.26% <32.48%> (-0.72%) :arrow_down:

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

Files Coverage Δ
...kages/thirdweb/src/pay/buyWithCrypto/getHistory.ts 71.42% <100.00%> (ø)
...b/src/react/web/ui/ConnectWallet/ConnectButton.tsx 58.19% <100.00%> (ø)
...eb/src/react/web/ui/ConnectWallet/defaultTokens.ts 100.00% <100.00%> (ø)
...thirdweb/src/react/web/ui/components/ChainIcon.tsx 48.52% <ø> (-0.75%) :arrow_down:
...hirdweb/src/react/web/ui/design-system/elements.ts 100.00% <100.00%> (ø)
...ckages/thirdweb/src/pay/buyWithCrypto/getStatus.ts 81.37% <97.72%> (ø)
.../react/web/ui/ConnectWallet/screens/nativeToken.ts 75.00% <0.00%> (ø)
...ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts 83.33% <78.57%> (+47.84%) :arrow_up:
...ackages/thirdweb/src/pay/buyWithCrypto/getQuote.ts 68.99% <80.00%> (ø)
...rc/react/core/hooks/contract/useSendTransaction.ts 33.57% <20.00%> (+0.71%) :arrow_up:
... and 53 more

... and 8 files with indirect coverage changes

codecov[bot] avatar Apr 18 '24 16:04 codecov[bot]

/release-pr

MananTank avatar Apr 18 '24 17:04 MananTank

/release-pr

MananTank avatar Apr 18 '24 20:04 MananTank

/release-pr

MananTank avatar Apr 19 '24 20:04 MananTank

/release-pr

MananTank avatar Apr 22 '24 23:04 MananTank

/release-pr

MananTank avatar Apr 22 '24 23:04 MananTank

/release-pr

MananTank avatar Apr 22 '24 23:04 MananTank

/release-pr

MananTank avatar Apr 23 '24 11:04 MananTank

/release-pr

MananTank avatar Apr 23 '24 16:04 MananTank

/release-pr

MananTank avatar Apr 25 '24 20:04 MananTank

/release-pr

MananTank avatar Apr 26 '24 19:04 MananTank

/release-pr

MananTank avatar Apr 29 '24 20:04 MananTank

/release-pr

MananTank avatar Apr 30 '24 22:04 MananTank

/release-pr

MananTank avatar Apr 30 '24 22:04 MananTank

/release-pr

MananTank avatar May 02 '24 14:05 MananTank

/release-pr

MananTank avatar May 02 '24 16:05 MananTank

/release-pr

MananTank avatar May 02 '24 17:05 MananTank

/release-pr

MananTank avatar May 02 '24 20:05 MananTank

/release-pr

MananTank avatar May 03 '24 00:05 MananTank

/release-pr

MananTank avatar May 03 '24 01:05 MananTank

/release-pr

MananTank avatar May 03 '24 02:05 MananTank

/release-pr

MananTank avatar May 03 '24 13:05 MananTank

/release-pr

MananTank avatar May 03 '24 19:05 MananTank

/release-pr

MananTank avatar May 03 '24 20:05 MananTank

/release-pr

MananTank avatar May 03 '24 21:05 MananTank

/release-pr

MananTank avatar May 03 '24 23:05 MananTank

/release-pr

MananTank avatar May 04 '24 00:05 MananTank