Skip to content

Commit

Permalink
fix: make tooltip contents selectable
Browse files Browse the repository at this point in the history
  • Loading branch information
meeh0w committed Dec 12, 2024
1 parent 0f46aec commit 6b13e6a
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/pages/Accounts/components/AccountItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,14 @@ export const AccountItem = forwardRef(
alignItems: 'center',
}}
>
<Tooltip title={address} disableInteractive>
<Tooltip
title={address}
slotProps={{
popper: {
onClick: (ev) => ev.stopPropagation(),
},
}}
>
<Typography
variant="caption"
color={isActive ? 'text.primary' : 'text.secondary'}
Expand Down Expand Up @@ -336,16 +343,13 @@ export const AccountItem = forwardRef(
AccountItem.displayName = 'AccountItem';

const getCopyEventNameByNetworkType = (type: NetworkVMType) => {
switch (type) {
case NetworkVMType.BITCOIN:
return 'AccountSelectorBtcAddressCopied';
case NetworkVMType.EVM:
return 'AccountSelectorEthAddressCopied';
case NetworkVMType.AVM:
return 'AccountSelectorAVMAddressCopied';
case NetworkVMType.PVM:
return 'AccountSelectorPVMAddressCopied';
default:
return 'AccountSelectorAddressCopied';
}
// We remap BTC and EVM because we used those in older event names
const normalizedType =
type === NetworkVMType.BITCOIN
? 'Btc'
: type === NetworkVMType.EVM
? 'Eth'
: type;

return `AccountSelector${normalizedType}AddressCopied`;
};

0 comments on commit 6b13e6a

Please sign in to comment.