fix(pay): allow topping up from a different wallet with the same currency (#4602)

Fixes CNCT-1835

<!-- start pr-codex -->

---

## PR-Codex overview
This PR allows topping up from a different wallet with the same currency.

### Detailed summary
- Enable topping up from a different wallet with the same currency
- Rename "Seller" to "Receiver" in ConfirmationScreen
- Modify condition in showSwapFlow to include "fund_wallet" mode

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

<!-- end pr-codex -->
This commit is contained in:
joaquim-verges
2024-09-15 22:12:10 +00:00
parent 575c3e3141
commit 07b949dd8c
4 changed files with 8 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---
Allow topping up from a different wallet with the same currency
@@ -1120,7 +1120,8 @@ function SwapScreenContent(props: {
function showSwapFlow() {
if (
props.payOptions.mode === "direct_payment" &&
(props.payOptions.mode === "direct_payment" ||
props.payOptions.mode === "fund_wallet") &&
!isNotEnoughBalance &&
!swapRequired
) {
@@ -126,7 +126,7 @@ export function SwapConfirmationScreen(props: {
{/* Send to */}
{isDifferentRecipient && (
<ConfirmItem label="Seller">
<ConfirmItem label="Receiver">
<Text color="primaryText" size="sm">
{ensName.data || shortenAddress(receiver)}
</Text>
@@ -23,8 +23,6 @@ export function usePayerSetup() {
const account = wallet.getAccount();
const chain = wallet.getChain();
if (account && chain) {
console.log("updated to", account, chain);
setPayer({
account,
chain,