This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Yash094/yash094
Add Customisations for ConnectWallet Component
- Loading branch information
Showing
4 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...ng/20 Connect/3 Connect Wallet Component/Customizations/10 Supported Tokens.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
slug: /connect/connect-wallet/supported-tokens | ||
title: Customize Supported Tokens | ||
--- | ||
|
||
Customize the tokens shown in the "Send Funds" screen for various networks. | ||
|
||
By default, The "Send Funds" screen shows a few popular tokens for default chains and the native token. For other chains it only shows the native token. | ||
|
||
|
||
```jsx | ||
import { Base } from "@thirdweb-dev/chains"; | ||
|
||
// Show "Dai Stablecoin" when connected to the "Base" mainnet | ||
<ConnectWallet | ||
supportedTokens={{ | ||
// use chain id of the network as key and pass an array of tokens to show | ||
// you can directly pass the number or import the chain object from @thirdweb-dev/chains to get the chain id | ||
[Base.chainId]: [ | ||
{ | ||
address: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb", // token contract address | ||
name: "Dai Stablecoin", | ||
symbol: "DAI", | ||
icon: "https://assets.coingecko.com/coins/images/9956/small/Badge_Dai.png?1687143508", | ||
}, | ||
], | ||
}} | ||
/> | ||
``` |
24 changes: 24 additions & 0 deletions
24
... Connect/3 Connect Wallet Component/Customizations/11 Display Token Balance.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
slug: /connect/connect-wallet/display-token-balance | ||
title: Display Token Balance | ||
--- | ||
|
||
Display the balance of a token instead of the native token in ConnectWallet details button. | ||
|
||
```jsx | ||
import { Base } from "@thirdweb-dev/chains"; | ||
|
||
// show Wrapped BTC balance when connected to Ethereum mainnet | ||
// Show Dai Stablecoin balance when connected to the Base mainnet | ||
|
||
<ConnectWallet | ||
// pass an object with chain id as key and token address as value | ||
displayBalanceToken={{ | ||
// 1 is chain id of Ethereum mainnet | ||
1: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", // contract address of Wrapped BTC token | ||
|
||
// you can also import the chain object from @thirdweb-dev/chains to get the chain id | ||
[Base.chainId]: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb", // contract address of Dai Stablecoin token | ||
}} | ||
/> | ||
``` |
13 changes: 13 additions & 0 deletions
13
...nect/3 Connect Wallet Component/Customizations/12 Switch To Personal Wallet.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
slug: /connect/connect-wallet/hide-switch-to-personal-wallet | ||
title: Switch To Personal Wallet | ||
--- | ||
|
||
Hide the "Switch to Personal wallet" option in the wallet modal which is shown when wallet is connected to either Smart Wallet or Safe | ||
|
||
Default is `false` | ||
|
||
|
||
```jsx | ||
<ConnectWallet hideSwitchToPersonalWallet={true} /> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters