-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add page for WalletDropdownDisconnect and WalletDropdownLink
- Loading branch information
Showing
4 changed files
with
194 additions
and
15 deletions.
There are no files selected for viewing
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
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,83 @@ | ||
import { | ||
ConnectWallet, | ||
Wallet, | ||
WalletDropdown, | ||
WalletDropdownLink, | ||
WalletDropdownBaseName, | ||
WalletDropdownDisconnect, | ||
} from '@coinbase/onchainkit/wallet'; | ||
import { | ||
Address, | ||
Avatar, | ||
Name, | ||
Identity, | ||
EthBalance, | ||
} from '@coinbase/onchainkit/identity'; | ||
import { color } from '@coinbase/onchainkit/theme'; | ||
import WalletComponents from '../../components/WalletComponents'; | ||
|
||
# `<WalletDropdownDisconnect />` | ||
|
||
The `WalletDropdownDisconnect` component is used to disconnect the wallet from the application. | ||
|
||
## Usage | ||
|
||
```tsx | ||
import { | ||
ConnectWallet, | ||
Wallet, | ||
WalletDropdown, | ||
WalletDropdownDisconnect, // [!code focus] | ||
} from '@coinbase/onchainkit/wallet'; | ||
import { | ||
Address, | ||
Avatar, | ||
Name, | ||
Identity, | ||
EthBalance, | ||
} from '@coinbase/onchainkit/identity'; | ||
import { color } from '@coinbase/onchainkit/theme'; | ||
|
||
export function WalletComponents() { | ||
return ( | ||
<div className="flex justify-end"> | ||
<Wallet> | ||
<ConnectWallet> | ||
<Avatar className="h-6 w-6" /> | ||
<Name /> | ||
</ConnectWallet> | ||
<WalletDropdown> | ||
<Identity className="px-4 pt-3 pb-2" hasCopyAddressOnClick> | ||
<Avatar /> | ||
<Name /> | ||
<Address className={color.foregroundMuted} /> | ||
<EthBalance /> | ||
</Identity> | ||
<WalletDropdownDisconnect /> // [!code focus] | ||
</WalletDropdown> | ||
</Wallet> | ||
</div> | ||
); | ||
} | ||
``` | ||
|
||
<WalletComponents> | ||
<Wallet> | ||
<ConnectWallet> | ||
<Avatar className="h-6 w-6" /> | ||
<Name /> | ||
</ConnectWallet> | ||
<WalletDropdown> | ||
<Identity className="px-4 pt-3 pb-2" hasCopyAddressOnClick> | ||
<Avatar /> | ||
<Name /> | ||
<Address className={color.foregroundMuted} /> | ||
<EthBalance /> | ||
</Identity> | ||
<WalletDropdownDisconnect /> | ||
</WalletDropdown> | ||
</Wallet> | ||
</WalletComponents> | ||
|
||
## Props | ||
- [`WalletDropdownDisconnectReact`](/wallet/types#walletdropdowndisconnectreact) |
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,90 @@ | ||
import { | ||
Address, | ||
Avatar, | ||
EthBalance, | ||
Identity, | ||
Name, | ||
} from '@coinbase/onchainkit/identity'; | ||
import { color } from '@coinbase/onchainkit/theme'; | ||
import { | ||
ConnectWallet, | ||
Wallet, | ||
WalletDropdown, | ||
WalletDropdownBaseName, | ||
WalletDropdownDisconnect, | ||
WalletDropdownLink, | ||
} from '@coinbase/onchainkit/wallet'; | ||
import WalletComponents from '../../components/WalletComponents'; | ||
|
||
# `<WalletDropdownLink />` | ||
|
||
The `WalletDropdownLink` creates a custom link within the dropdown. Use the icon prop to add an icon, and href to specify the destination. | ||
|
||
## Usage | ||
|
||
```tsx | ||
import { | ||
ConnectWallet, | ||
Wallet, | ||
WalletDropdown, | ||
WalletDropdownLink, // [!code focus] | ||
WalletDropdownDisconnect, | ||
} from '@coinbase/onchainkit/wallet'; | ||
import { | ||
Address, | ||
Avatar, | ||
Name, | ||
Identity, | ||
EthBalance, | ||
} from '@coinbase/onchainkit/identity'; | ||
import { color } from '@coinbase/onchainkit/theme'; | ||
|
||
export function WalletComponents() { | ||
return ( | ||
<div className="flex justify-end"> | ||
<Wallet> | ||
<ConnectWallet> | ||
<Avatar className="h-6 w-6" /> | ||
<Name /> | ||
</ConnectWallet> | ||
<WalletDropdown> | ||
<Identity className="px-4 pt-3 pb-2" hasCopyAddressOnClick> | ||
<Avatar /> | ||
<Name /> | ||
<Address className={color.foregroundMuted} /> | ||
<EthBalance /> | ||
</Identity> | ||
<WalletDropdownLink icon="wallet" href="https://wallet.coinbase.com"> // [!code focus] | ||
Wallet // [!code focus] | ||
</WalletDropdownLink> // [!code focus] | ||
<WalletDropdownDisconnect /> | ||
</WalletDropdown> | ||
</Wallet> | ||
</div> | ||
); | ||
} | ||
``` | ||
|
||
<WalletComponents> | ||
<Wallet> | ||
<ConnectWallet> | ||
<Avatar className="h-6 w-6" /> | ||
<Name /> | ||
</ConnectWallet> | ||
<WalletDropdown> | ||
<Identity className="px-4 pt-3 pb-2" hasCopyAddressOnClick> | ||
<Avatar /> | ||
<Name /> | ||
<Address className={color.foregroundMuted} /> | ||
<EthBalance /> | ||
</Identity> | ||
<WalletDropdownLink icon="wallet" href="https://wallet.coinbase.com"> | ||
Wallet | ||
</WalletDropdownLink> | ||
<WalletDropdownDisconnect /> | ||
</WalletDropdown> | ||
</Wallet> | ||
</WalletComponents> | ||
|
||
## Props | ||
- [`WalletDropdownLinkReact`](/wallet/types#walletdropdownlinkreact) |
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