Skip to content

Commit

Permalink
fix: copy to clipboard button accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-st committed Sep 19, 2024
1 parent a8eadc0 commit 6a57d67
Showing 1 changed file with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,34 @@ export const AddressInfoDropdown = ({
<NetworkOptions hidden={!selectingNetwork} />
{!selectingNetwork && (
<>
<DropdownMenuItem asChild>
<Button variant="ghost" size="sm" className="w-full justify-start">
{addressCopied ? (
<div className="flex items-center">
<CheckCircleIcon
className="text-xl font-normal h-6 w-4 cursor-pointer mr-2 ml-2 sm:ml-0"
aria-hidden="true"
/>
<span className="whitespace-nowrap">Copied!</span>
</div>
) : (
<CopyToClipboard
text={checkSumAddress}
onCopy={() => {
setAddressCopied(true);
setTimeout(() => {
setAddressCopied(false);
}, 800);
}}
>
<div className="flex items-center w-full">
<CopyToClipboard
text={checkSumAddress}
onCopy={() => {
setAddressCopied(true);
setTimeout(() => {
setAddressCopied(false);
}, 800);
}}
>
<DropdownMenuItem asChild>
<Button variant="ghost" size="sm" className="w-full justify-start">
{addressCopied ? (
<>
<CheckCircleIcon
className="text-xl font-normal h-6 w-4 cursor-pointer mr-2 ml-2 sm:ml-0"
aria-hidden="true"
/>
<span className="whitespace-nowrap">Copied!</span>
</>
) : (
<>
<DocumentDuplicateIcon className="text-xl font-normal h-6 w-4 mr-2" aria-hidden="true" />
<span className="whitespace-nowrap">Copy address</span>
</div>
</CopyToClipboard>
)}
</Button>
</DropdownMenuItem>
</>
)}
</Button>
</DropdownMenuItem>
</CopyToClipboard>
<AddressQRCodeModal address={address}>
<DropdownMenuItem asChild>
<Button variant="ghost" size="sm" className="w-full">
Expand Down

0 comments on commit 6a57d67

Please sign in to comment.