Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from Yash094/yash094
Browse files Browse the repository at this point in the history
Add Customisations for ConnectWallet Component
  • Loading branch information
Yash094 authored Jan 4, 2024
2 parents 2b330e4 + 640d503 commit 5ade8b5
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 16 deletions.
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",
},
],
}}
/>
```
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
}}
/>
```
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} />
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@ title: Customizations

The following customizations are available for the Connect Wallet component:

| Prop Name | Description |
| ---------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [Displayed Wallet Providers](/connect/connect-wallet/wallet-providers) | Customize the wallets that are displayed. |
| [Modal Size](/connect/connect-wallet/modal-size) | The size of the Connect Wallet modal. |
| [Theme](/connect/connect-wallet/theme) | The theme of the Connect Wallet component. The default is "light". |
| [Button Title](/connect/connect-wallet/button-title) | The title of the Connect Wallet button. |
| [Modal Title](/connect/connect-wallet/modal-title) | The title of the Connect Wallet modal. |
| [Modal Size](/connect/connect-wallet/modal-size) | The size of the Connect Wallet modal. "compact" or "wide" |
| [Welcome Screen](/connect/connect-wallet/welcome-screen) | Customize the welcome screen on wide modal. |
| [Custom CSS](/connect/connect-wallet/class-name) | Apply custom CSS styles to the Connect Wallet button. |
| [Button UI](/connect/connect-wallet/custom-button) | Customize the details button. |
| [Modal Drop-Down Position](/connect/connect-wallet/drop-down-position) | Specify where should the dropdown menu open. |
| [Authorization](/connect/connect-wallet/auth) | Enforce that users must sign in with their wallet. |
| [Switch To Active Chain](/connect/connect-wallet/switch-chain) | Automatically switch to the active chain when connecting a wallet. |
| [Terms Of Service URL](/connect/connect-wallet/terms-of-service) | The URL to the terms of service page. |
| [Privacy Policy URL](/connect/connect-wallet/privacy-policy) | The URL to the privacy policy page. |
| Prop Name | Description |
| ------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [Displayed Wallet Providers](/connect/connect-wallet/wallet-providers) | Customize the wallets that are displayed. |
| [Modal Size](/connect/connect-wallet/modal-size) | The size of the Connect Wallet modal. |
| [Theme](/connect/connect-wallet/theme) | The theme of the Connect Wallet component. The default is "light". |
| [Button Title](/connect/connect-wallet/button-title) | The title of the Connect Wallet button. |
| [Modal Title](/connect/connect-wallet/modal-title) | The title of the Connect Wallet modal. |
| [Modal Size](/connect/connect-wallet/modal-size) | The size of the Connect Wallet modal. "compact" or "wide" |
| [Welcome Screen](/connect/connect-wallet/welcome-screen) | Customize the welcome screen on wide modal. |
| [Custom CSS](/connect/connect-wallet/class-name) | Apply custom CSS styles to the Connect Wallet button. |
| [Button UI](/connect/connect-wallet/custom-button) | Customize the details button. |
| [Modal Drop-Down Position](/connect/connect-wallet/drop-down-position) | Specify where should the dropdown menu open. |
| [Authorization](/connect/connect-wallet/auth) | Enforce that users must sign in with their wallet. |
| [Switch To Active Chain](/connect/connect-wallet/switch-chain) | Automatically switch to the active chain when connecting a wallet. |
| [Terms Of Service URL](/connect/connect-wallet/terms-of-service) | The URL to the terms of service page. |
| [Privacy Policy URL](/connect/connect-wallet/privacy-policy) | The URL to the privacy policy page. |
| [Hide Testnet Faucet](/connect/connect-wallet/hide-testnet-faucet) | Hide request testnet funds option when connected to testnets |
| [Customize Supported Tokens](/connect/connect-wallet/supported-tokens) | Customize the tokens shown in the "Send Funds" screen |
| [Display Token Balance](/connect/connect-wallet/display-token-balance) | Display the balance of a token instead of the native token |
| [Switch To Personal Wallet](/connect/connect-wallet/hide-switch-to-personal-wallet) | Hide the "Switch to Personal wallet" option in the wallet modal |

0 comments on commit 5ade8b5

Please sign in to comment.