Skip to content

Commit

Permalink
Use link for account
Browse files Browse the repository at this point in the history
Instead of a click-handler
  • Loading branch information
csillag committed Nov 30, 2023
1 parent 1f184ed commit 787ecfd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/Account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@ export const Account: FC<Props> = ({ address, networkName }) => {
state: { explorerBaseUrl },
} = useWeb3()

const handleAccountClick = () => {
if (explorerBaseUrl) {
window.open(StringUtils.getAccountUrl(explorerBaseUrl, address), '_blank', 'noopener,noreferrer')
}
}
const url = explorerBaseUrl ? StringUtils.getAccountUrl(explorerBaseUrl, address) : undefined

return (
<div className={classes.account} onClick={handleAccountClick}>
<a href={url} className={classes.account} target="_blank" rel="nofollow noreferrer">
<JazzIcon size={isXlScreen ? 60 : 30} address={address} />
<p className={classes.accountDetails}>
<abbr title={address} className={classes.accountAddress}>
{StringUtils.truncateAddress(address)}
</abbr>
<span className={classes.network}>{networkName}</span>
</p>
</div>
</a>
)
}

0 comments on commit 787ecfd

Please sign in to comment.