Commit be1f9f3e authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #123 from blockscout/tx-link

fix tx link
parents 32d9cf05 ff834f0d
......@@ -31,7 +31,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return (
<Tr alignItems="top" key={ item.id }>
<Td>
<AddressLinkWithTooltip address={ item.transaction_hash }/>
<AddressLinkWithTooltip address={ item.transaction_hash } type="transaction"/>
</Td>
<Td>
<Tooltip label={ item.name }>
......
......@@ -8,9 +8,19 @@ import CopyToClipboard from './CopyToClipboard';
const FONT_WEIGHT = '600';
const AddressLinkWithTooltip = ({ address }: {address: string}) => {
type Props = {
address: string;
type?: 'address' | 'transaction';
}
const AddressLinkWithTooltip = ({ address, type = 'address' }: Props) => {
const basePath = useBasePath();
const url = basePath + '/address/' + address + '/tokens#address-tabs';
let url;
if (type === 'transaction') {
url = basePath + '/tx/' + address;
} else {
url = basePath + '/address/' + address + '/tokens#address-tabs';
}
return (
<HStack spacing={ 2 } alignContent="center" overflow="hidden">
<Link
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment