From d7fa8fe484b1bd61f74b175961ba8aa71b66d8a1 Mon Sep 17 00:00:00 2001 From: martinshub-tech Date: Wed, 26 Aug 2026 13:47:36 +0100 Subject: [PATCH] feat: redesign WalletConnect visual states as HUD controls --- src/components/WalletConnect.test.tsx | 4 +- src/components/WalletConnect.tsx | 99 +++++++++++++-------------- 2 files changed, 50 insertions(+), 53 deletions(-) diff --git a/src/components/WalletConnect.test.tsx b/src/components/WalletConnect.test.tsx index d99fb97..1ca02be 100644 --- a/src/components/WalletConnect.test.tsx +++ b/src/components/WalletConnect.test.tsx @@ -125,7 +125,7 @@ describe('WalletConnect', () => { render(); const connectButton = screen.getByRole('button', { name: /connect wallet/i }); - expect(connectButton).toHaveClass('bg-[#2C4BFD]', 'hover:bg-[#1a3bf0]', 'text-white'); + expect(connectButton).toHaveClass('bg-white', 'hover:bg-gray-50', 'text-gray-700'); }); }); @@ -338,7 +338,7 @@ describe('WalletConnect', () => { render(); const container = screen.getByText('GTES...WXYZ').closest('.flex'); - expect(container).toHaveClass('gap-1', 'sm:gap-2'); + expect(container).toHaveClass('gap-2'); }); }); diff --git a/src/components/WalletConnect.tsx b/src/components/WalletConnect.tsx index 166d91d..cac244c 100644 --- a/src/components/WalletConnect.tsx +++ b/src/components/WalletConnect.tsx @@ -68,19 +68,8 @@ const WalletConnect = () => { )} -
-
- - {balance ? Balance: : Balance unavailable} - - -
- -
+
+
{ type="button" onClick={disconnect} className={clsx( - 'shrink-0 p-2 rounded-lg text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20', + 'shrink-0 p-1.5 rounded-full text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 ml-1', focusRing )} aria-label="Disconnect wallet" @@ -118,6 +107,16 @@ const WalletConnect = () => {
+
+ + {balance ? Balance: : Balance unavailable} + + +
@@ -168,29 +167,28 @@ const WalletConnect = () => { if (status === 'error' && errorMessage) { return ( -
-

+

+
+ +
+

{errorMessage}

-
- -
+
); } @@ -202,29 +200,28 @@ const WalletConnect = () => { onClick={() => setIsPickerOpen(true)} disabled={status === 'connecting' || status === 'checking'} className={clsx( - 'flex items-center gap-2 px-4 py-2 rounded-lg font-semibold transition-all duration-200', - 'bg-[#2C4BFD] hover:bg-[#1a3bf0] text-white shadow-lg shadow-blue-500/20', + 'flex items-center gap-2 p-1 pr-4 rounded-full font-semibold transition-all duration-200 w-fit', + 'bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 shadow-sm', + 'hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-200', 'disabled:opacity-70 disabled:cursor-not-allowed', focusRing )} aria-busy={status === 'connecting' || status === 'checking'} > - {status === 'connecting' ? ( - <> +
+ {status === 'connecting' || status === 'checking' ? ( - Connecting… - - ) : status === 'checking' ? ( - <> - - Checking wallet… - - ) : ( - <> + ) : ( - Connect Wallet - - )} + )} +
+ + {status === 'connecting' + ? 'Connecting…' + : status === 'checking' + ? 'Checking wallet…' + : 'Connect Wallet'} +