address fixes

This commit is contained in:
tom
2022-10-11 14:30:29 +03:00
parent 741c7a93c0
commit ecdee5c85b
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
export default function hexToAddress(hex: string) {
return hex.slice(0, 2) + hex.slice(26);
const shortenHex = hex.slice(0, 66);
return shortenHex.slice(0, 2) + shortenHex.slice(26);
}
+5 -1
View File
@@ -4,6 +4,7 @@ import React from 'react';
import hexToAddress from 'lib/hexToAddress';
import hexToUtf8 from 'lib/hexToUtf8';
import Address from 'ui/shared/address/Address';
import AddressLink from 'ui/shared/address/AddressLink';
import CopyToClipboard from 'ui/shared/CopyToClipboard';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
@@ -49,7 +50,10 @@ const TxLogTopic = ({ hex, index }: Props) => {
case 'address': {
return (
<AddressLink hash={ hexToAddress(hex) }/>
<Address>
<AddressLink hash={ value }/>
<CopyToClipboard text={ value }/>
</Address>
);
}
}