Truncate addresses by 2 chars to compensate for color dot width
Some checks failed
check / check (push) Has been cancelled

Move truncateMiddle to helpers.js for reuse. Shorten displayed addresses
by 2 characters wherever a dot is shown: home view (40 char max), tx list
(maxAddr - 2), and address detail container (40ch width).
This commit is contained in:
2026-02-26 03:29:09 +07:00
parent 138468287c
commit 166bb46149
4 changed files with 13 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ const {
showFlash,
balanceLinesForAddress,
addressDotHtml,
truncateMiddle,
} = require("./helpers");
const { state, saveState } = require("../../shared/state");
const { deriveAddressFromXpub } = require("../../shared/wallet");
@@ -47,7 +48,7 @@ function render(ctx) {
}
const addrUsd = formatUsd(getAddressValueUsd(addr));
html += `<div class="flex text-xs">`;
html += `<span class="flex items-center" style="width:42ch;max-width:100%">${addr.ensName ? "" : dot}${addr.address}</span>`;
html += `<span class="flex items-center" style="width:42ch;max-width:100%">${addr.ensName ? "" : dot}${truncateMiddle(addr.address, 40)}</span>`;
html += `<span class="text-right text-muted flex-1">${addrUsd}</span>`;
html += `</div>`;
html += balanceLinesForAddress(addr);