Fix display consistency across all views
All checks were successful
check / check (push) Successful in 18s

Receive view: address now shows color dot and etherscan link,
matching every other address display in the app.

Send view "From": address now includes etherscan link alongside
the existing color dot.

Send view "What to send" (ERC-20 from token view): shows token
symbol as bold heading, then full contract address below with
color dot, copy-on-click, and etherscan link.

Approval views: tx approval From/To addresses now show color
dots and etherscan links instead of bare text. Site approval
address adds etherscan link. Tx approval value uses 4 decimal
places consistent with all other amount displays.

Home tx list: row padding changed from py-1 to py-2, matching
addressDetail and addressToken transaction lists.
This commit is contained in:
2026-02-27 12:01:34 +07:00
parent a43e8f20ea
commit e58f113cda
6 changed files with 85 additions and 21 deletions

View File

@@ -340,13 +340,27 @@ function init(ctx) {
}
// Hide dropdown, show static token display
$("send-token").classList.add("hidden");
let staticHtml = escapeHtml(currentSymbol);
let staticHtml = `<div class="font-bold">${escapeHtml(currentSymbol)}</div>`;
if (tokenId !== "ETH") {
const dot = addressDotHtml(tokenId);
const link = `https://etherscan.io/token/${tokenId}`;
staticHtml += ` <a href="${link}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
const extLink = `<a href="${link}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
staticHtml +=
`<div class="flex items-center text-xs">${dot}` +
`<span class="break-all underline decoration-dashed cursor-pointer" data-copy="${escapeHtml(tokenId)}">${escapeHtml(tokenId)}</span>` +
extLink +
`</div>`;
}
$("send-token-static").innerHTML = staticHtml;
$("send-token-static").classList.remove("hidden");
// Attach copy handler for the contract address
const copyEl = $("send-token-static").querySelector("[data-copy]");
if (copyEl) {
copyEl.addEventListener("click", () => {
navigator.clipboard.writeText(copyEl.dataset.copy);
showFlash("Copied!");
});
}
updateSendBalance();
showView("send");
});
@@ -354,7 +368,12 @@ function init(ctx) {
$("btn-address-token-receive").addEventListener("click", () => {
const addr = currentAddress();
const address = addr ? addr.address : "";
$("receive-dot").innerHTML = address ? addressDotHtml(address) : "";
$("receive-address").textContent = address;
const addrLink = address ? etherscanAddressLink(address) : "";
$("receive-etherscan-link").innerHTML = addrLink
? `<a href="${addrLink}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`
: "";
if (address) {
QRCode.toCanvas($("receive-qr"), address, {
width: 200,