Merge pull request #1850 from siiky/fix/lam-1057/shorten-ln-addresses

LAM-1057 feat: shorten long addresses
This commit is contained in:
Rafael Taranto 2025-05-16 07:10:16 +01:00 committed by GitHub
commit 910f996db6
4 changed files with 44 additions and 17 deletions

View file

@ -13,6 +13,7 @@ const CopyToClipboard = ({
className,
buttonClassname,
children,
value,
wrapperClassname,
removeSpace = true,
}) => {
@ -33,6 +34,12 @@ const CopyToClipboard = ({
const open = Boolean(anchorEl)
const id = open ? 'simple-popper' : undefined
const text = value
? value
: removeSpace
? R.replace(/\s/g, '')(children)
: children
return (
<div className={classnames('flex items-center', wrapperClassname)}>
{children && (
@ -43,8 +50,7 @@ const CopyToClipboard = ({
{children}
</Mono>
<div className={buttonClassname}>
<ReactCopyToClipboard
text={removeSpace ? R.replace(/\s/g, '')(children) : children}>
<ReactCopyToClipboard text={text}>
<button
className="border-0 bg-transparent cursor-pointer"
aria-describedby={id}