Compare commits

..

1 Commits

Author SHA1 Message Date
user
7d1d584b52 feat: make block number click-to-copy with Etherscan external link on success-tx view
All checks were successful
check / check (push) Successful in 7s
Closes #99

The block number on the success-tx view is now styled consistently with
other blockchain entities (addresses, tx hashes): it has a dashed underline
for click-to-copy and an external link icon pointing to etherscan.io/block/.
2026-02-28 14:52:06 -08:00

View File

@@ -50,6 +50,15 @@ function toAddressHtml(address) {
return `<div class="flex items-center">${dot}<span class="break-all underline decoration-dashed cursor-pointer" data-copy="${escapeHtml(address)}">${escapeHtml(address)}</span>${extLink}</div>`;
}
function txHashHtml(hash) {
const link = `https://etherscan.io/tx/${hash}`;
const extLink = `<a href="${link}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
return (
`<span class="underline decoration-dashed cursor-pointer break-all" data-copy="${escapeHtml(hash)}">${escapeHtml(hash)}</span>` +
extLink
);
}
function blockNumberHtml(blockNumber) {
const num = String(blockNumber);
const link = `https://etherscan.io/block/${num}`;
@@ -60,15 +69,6 @@ function blockNumberHtml(blockNumber) {
);
}
function txHashHtml(hash) {
const link = `https://etherscan.io/tx/${hash}`;
const extLink = `<a href="${link}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
return (
`<span class="underline decoration-dashed cursor-pointer break-all" data-copy="${escapeHtml(hash)}">${escapeHtml(hash)}</span>` +
extLink
);
}
function attachCopyHandlers(viewId) {
document
.getElementById(viewId)