Commit bad38f01 authored by isstuev's avatar isstuev

external link custom content

parent 9a551936
...@@ -92,7 +92,7 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => { ...@@ -92,7 +92,7 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
<Text fontSize="sm">Verify with other explorers</Text> <Text fontSize="sm">Verify with other explorers</Text>
{ explorers.map((explorer) => { { explorers.map((explorer) => {
const url = new URL(explorer.paths.address + '/' + addressHash, explorer.baseUrl); const url = new URL(explorer.paths.address + '/' + addressHash, explorer.baseUrl);
return <LinkExternal key={ explorer.baseUrl } title={ explorer.title } href={ url.toString() }/>; return <LinkExternal key={ explorer.baseUrl } href={ url.toString() }>{ explorer.title }</LinkExternal>;
}) } }) }
</Flex> </Flex>
) } ) }
......
...@@ -115,7 +115,7 @@ const ContractCode = () => { ...@@ -115,7 +115,7 @@ const ContractCode = () => {
{ data.is_verified_via_sourcify && ( { data.is_verified_via_sourcify && (
<Alert status="warning" whiteSpace="pre-wrap" flexWrap="wrap"> <Alert status="warning" whiteSpace="pre-wrap" flexWrap="wrap">
<span>This contract has been { data.is_partially_verified ? 'partially ' : '' }verified via Sourcify. </span> <span>This contract has been { data.is_partially_verified ? 'partially ' : '' }verified via Sourcify. </span>
{ data.sourcify_repo_url && <LinkExternal href={ data.sourcify_repo_url } title="View contract in Sourcify repository" fontSize="md"/> } { data.sourcify_repo_url && <LinkExternal href={ data.sourcify_repo_url } fontSize="md">View contract in Sourcify repository</LinkExternal> }
</Alert> </Alert>
) } ) }
{ data.is_changed_bytecode && ( { data.is_changed_bytecode && (
......
...@@ -46,7 +46,7 @@ const TransactionPageContent = () => { ...@@ -46,7 +46,7 @@ const TransactionPageContent = () => {
.filter((explorer) => explorer.paths.tx) .filter((explorer) => explorer.paths.tx)
.map((explorer) => { .map((explorer) => {
const url = new URL(explorer.paths.tx + '/' + hash, explorer.baseUrl); const url = new URL(explorer.paths.tx + '/' + hash, explorer.baseUrl);
return <LinkExternal key={ explorer.baseUrl } title={ `Open in ${ explorer.title }` } href={ url.toString() }/>; return <LinkExternal key={ explorer.baseUrl } href={ url.toString() }>{ `Open in ${ explorer.title }` }</LinkExternal>;
}); });
const additionals = ( const additionals = (
......
...@@ -5,14 +5,14 @@ import arrowIcon from 'icons/arrows/north-east.svg'; ...@@ -5,14 +5,14 @@ import arrowIcon from 'icons/arrows/north-east.svg';
interface Props { interface Props {
href: string; href: string;
title: string;
className?: string; className?: string;
children: React.ReactNode;
} }
const LinkExternal = ({ href, title, className }: Props) => { const LinkExternal = ({ href, children, className }: Props) => {
return ( return (
<Link className={ className } fontSize="sm" display="inline-flex" alignItems="center" target="_blank" href={ href }> <Link className={ className } fontSize="sm" display="inline-flex" alignItems="center" target="_blank" href={ href }>
{ title } { children }
<Icon as={ arrowIcon } boxSize={ 4 }/> <Icon as={ arrowIcon } boxSize={ 4 }/>
</Link> </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