From 94acf5e6860df515fe13aebf33afe51877638b25 Mon Sep 17 00:00:00 2001 From: bucky Date: Sat, 25 Jul 2026 00:14:57 +0100 Subject: [PATCH] feat: add wallet connection UI with address display, copy action, and disconnect flow - Add popover showing full wallet address when connected - Include copy-to-clipboard button with confirmation feedback - Add disconnect button that opens confirmation dialog - Close popover on outside click or Escape key Closes accesslayerorg/accesslayer-client#548 --- src/components/common/ConnectWalletButton.tsx | 91 +++++++++++++++---- 1 file changed, 71 insertions(+), 20 deletions(-) diff --git a/src/components/common/ConnectWalletButton.tsx b/src/components/common/ConnectWalletButton.tsx index 9ab1372..d2ca081 100644 --- a/src/components/common/ConnectWalletButton.tsx +++ b/src/components/common/ConnectWalletButton.tsx @@ -1,6 +1,16 @@ import { useEffect, useRef, useState } from 'react'; import { useAccount, useConnect, useDisconnect } from 'wagmi'; import { Copy, Check } from 'lucide-react'; +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog'; +import { Button } from '@/components/ui/button'; import { Popover, PopoverContent, @@ -21,6 +31,7 @@ function ConnectWalletButton() { const [showAddressPopover, setShowAddressPopover] = useState(false); const [copied, setCopied] = useState(false); const connectedAtRef = useRef(null); + const [showDisconnectDialog, setShowDisconnectDialog] = useState(false); const { address, isConnected } = useAccount(); const { connect, connectors, error, isPending } = useConnect(); const { disconnect } = useDisconnect(); @@ -74,41 +85,45 @@ function ConnectWalletButton() { {shortenAddress(address)} - -
-
-

- Wallet address + +

+
+ + Connected Wallet + + +
+
+

+ {address}

-

{address}

-
+
@@ -117,6 +132,42 @@ function ConnectWalletButton() {
+ + + + Disconnect wallet? + + Disconnecting clears your current wallet session and any + pending wallet state. You will need to reconnect to + continue. + + + + + + + + + + );