Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer committed Nov 26, 2024
1 parent 1ec0a72 commit 1ef1a0d
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/wallet/components/WalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function WalletModal({

const modal = modalRef.current;
const focusableElements = modal.querySelectorAll<HTMLElement>(
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',
);

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: TODO: Refactor
Expand Down Expand Up @@ -99,7 +99,9 @@ export function WalletModal({
console.error('Coinbase Wallet connection error:', error);
if (onError) {
onError(
error instanceof Error ? error : new Error('Failed to connect wallet')
error instanceof Error
? error
: new Error('Failed to connect wallet'),
);
}
}
Expand All @@ -118,15 +120,17 @@ export function WalletModal({
console.error('WalletConnect connection error:', error);
if (onError) {
onError(
error instanceof Error ? error : new Error('Failed to connect wallet')
error instanceof Error
? error
: new Error('Failed to connect wallet'),
);
}
}
}, [connect, onClose, onError]);

const handleLinkKeyDown = (
event: React.KeyboardEvent<HTMLAnchorElement>,
url: string
url: string,
) => {
if (event.key === 'Enter') {
event.preventDefault();
Expand All @@ -144,7 +148,7 @@ export function WalletModal({
'fixed inset-0 z-50 flex items-center justify-center',
'bg-black/70 transition-opacity duration-200',
isOpen ? 'opacity-100' : 'opacity-0',
className
className,
)}
onClick={onClose}
onKeyDown={(e) => e.key === 'Enter' && onClose()}
Expand All @@ -163,7 +167,7 @@ export function WalletModal({
'relative',
'-translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2',
'transition-opacity duration-200',
isOpen ? 'opacity-100' : 'opacity-0'
isOpen ? 'opacity-100' : 'opacity-0',
)}
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => e.key === 'Enter' && e.stopPropagation()}
Expand All @@ -176,14 +180,14 @@ export function WalletModal({
className={cn(
'absolute top-4 right-4',
'flex items-center justify-center',
'h-3 w-3'
'h-3 w-3',
)}
aria-label="Close modal"
>
<div
className={cn(
'relative h-full w-full transition-colors',
'[&>svg>path]:hover:fill-[var(--ock-icon-color-foreground-muted)]'
'[&>svg>path]:hover:fill-[var(--ock-icon-color-foreground-muted)]',
)}
>
{closeSvg}
Expand Down Expand Up @@ -218,7 +222,7 @@ export function WalletModal({
pressable.alternate,
color.foreground,
'h-10 w-[275px] px-4 py-2.5',
'flex items-center justify-between text-left'
'flex items-center justify-between text-left',
)}
>
Sign up
Expand All @@ -235,7 +239,7 @@ export function WalletModal({
background.default,
color.foregroundMuted,
text.legal,
'px-2'
'px-2',
)}
>
or continue with an existing wallet
Expand All @@ -254,7 +258,7 @@ export function WalletModal({
pressable.alternate,
color.foreground,
'h-10 w-[275px] px-4 py-2.5',
'flex items-center justify-between text-left'
'flex items-center justify-between text-left',
)}
>
Coinbase Wallet
Expand All @@ -272,7 +276,7 @@ export function WalletModal({
pressable.alternate,
color.foreground,
'flex h-[40px] w-[275px] px-4 py-2.5',
'items-center justify-between text-left'
'items-center justify-between text-left',
)}
>
Other wallets
Expand All @@ -285,7 +289,7 @@ export function WalletModal({
color.foregroundMuted,
text.legal,
'flex flex-col items-center justify-center gap-1 px-4',
'mt-4 w-[275px] text-center leading-3'
'mt-4 w-[275px] text-center leading-3',
)}
>
<span className="font-normal text-[10px] leading-[13px]">
Expand Down

0 comments on commit 1ef1a0d

Please sign in to comment.