Fix display consistency across all views
All checks were successful
check / check (push) Successful in 18s
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:
@@ -1,11 +1,18 @@
|
||||
// Send view: collect To, Amount, Token. Then go to confirmation.
|
||||
|
||||
const { $, showFlash, formatAddressHtml } = require("./helpers");
|
||||
const { $, showFlash, addressDotHtml, escapeHtml } = require("./helpers");
|
||||
const { state, currentAddress } = require("../../shared/state");
|
||||
let ctx;
|
||||
const { getProvider } = require("../../shared/balances");
|
||||
const { KNOWN_SYMBOLS } = require("../../shared/tokens");
|
||||
|
||||
const EXT_ICON =
|
||||
`<span style="display:inline-block;width:10px;height:10px;margin-left:4px;vertical-align:middle">` +
|
||||
`<svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5">` +
|
||||
`<path d="M4.5 1.5H2a.5.5 0 00-.5.5v8a.5.5 0 00.5.5h8a.5.5 0 00.5-.5V7.5"/>` +
|
||||
`<path d="M7 1.5h3.5V5M7 5.5L10.5 1.5"/>` +
|
||||
`</svg></span>`;
|
||||
|
||||
function isSpoofedToken(t) {
|
||||
const upper = (t.symbol || "").toUpperCase();
|
||||
if (!KNOWN_SYMBOLS.has(upper)) return false;
|
||||
@@ -34,11 +41,17 @@ function renderSendTokenSelect(addr) {
|
||||
function updateSendBalance() {
|
||||
const addr = currentAddress();
|
||||
if (!addr) return;
|
||||
$("send-from").innerHTML = formatAddressHtml(
|
||||
addr.address,
|
||||
addr.ensName || null,
|
||||
null,
|
||||
);
|
||||
const dot = addressDotHtml(addr.address);
|
||||
const link = `https://etherscan.io/address/${addr.address}`;
|
||||
const extLink = `<a href="${link}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
|
||||
let fromHtml = "";
|
||||
if (addr.ensName) {
|
||||
fromHtml += `<div class="flex items-center font-bold">${dot}${escapeHtml(addr.ensName)}</div>`;
|
||||
fromHtml += `<div class="break-all">${escapeHtml(addr.address)}${extLink}</div>`;
|
||||
} else {
|
||||
fromHtml += `<div class="flex items-center">${dot}<span class="break-all">${escapeHtml(addr.address)}</span>${extLink}</div>`;
|
||||
}
|
||||
$("send-from").innerHTML = fromHtml;
|
||||
const token = state.selectedToken || $("send-token").value;
|
||||
if (token === "ETH") {
|
||||
$("send-balance").textContent =
|
||||
|
||||
Reference in New Issue
Block a user