Skip to content

Commit 775ab6d

Browse files
committed
Add/Fix options for hiding buttons on details modal on useWalletDetailsModal (#4450)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview The focus of this PR is to add options for hiding buttons on the details modal in the `ConnectWallet` feature. ### Detailed summary - Added options to hide "Send Funds," "Receive Funds," and "Buy Funds" buttons in the details modal - Updated `ConnectButton.tsx` and `Details.tsx` to include new hide options - Modified `UseWalletDetailsModalOptions` type to support new hide options > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 5fea748 commit 775ab6d

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

.changeset/tough-bees-arrive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Add options for hiding buttons on details modal on useWalletDetailsModal

packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,6 @@ function ConnectButtonInner(
544544
showAllWallets: props.showAllWallets,
545545
walletConnect: props.walletConnect,
546546
wallets: props.wallets,
547-
hideReceiveFunds: props.detailsModal?.hideReceiveFunds,
548-
hideSendFunds: props.detailsModal?.hideSendFunds,
549-
hideBuyFunds: props.detailsModal?.hideBuyFunds,
550547
}}
551548
/>
552549
);

packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,6 @@ export type DetailsModalConnectOptions = {
11501150
chains?: Chain[];
11511151
recommendedWallets?: Wallet[];
11521152
showAllWallets?: boolean;
1153-
hideSendFunds?: boolean;
1154-
hideReceiveFunds?: boolean;
1155-
hideBuyFunds?: boolean;
11561153
};
11571154

11581155
export type UseWalletDetailsModalOptions = {
@@ -1376,6 +1373,27 @@ export type UseWalletDetailsModalOptions = {
13761373
* Use custom avatar URL for the connected wallet image in the `ConnectButton` Details Modal, overriding ENS avatar or Blobbie icon.
13771374
*/
13781375
connectedAccountAvatarUrl?: string;
1376+
1377+
/**
1378+
* Hide the "Send Funds" button in the Details Modal.
1379+
*
1380+
* By default the "Send Funds" button is shown.
1381+
*/
1382+
hideSendFunds?: boolean;
1383+
1384+
/**
1385+
* Hide the "Receive Funds" button in the Details Modal.
1386+
*
1387+
* By default the "Receive Funds" button is shown.
1388+
*/
1389+
hideReceiveFunds?: boolean;
1390+
1391+
/**
1392+
* Hide the "Buy Funds" button in the Details Modal.
1393+
*
1394+
* By default the "Buy Funds" button is shown.
1395+
*/
1396+
hideBuyFunds?: boolean;
13791397
};
13801398

13811399
/**
@@ -1430,6 +1448,9 @@ export function useWalletDetailsModal() {
14301448
showTestnetFaucet: props.showTestnetFaucet,
14311449
connectedAccountName: props.connectedAccountName,
14321450
connectedAccountAvatarUrl: props.connectedAccountAvatarUrl,
1451+
hideBuyFunds: props.hideBuyFunds,
1452+
hideReceiveFunds: props.hideReceiveFunds,
1453+
hideSendFunds: props.hideSendFunds,
14331454
}}
14341455
displayBalanceToken={props.displayBalanceToken}
14351456
theme={props.theme || "dark"}

0 commit comments

Comments
 (0)