Replace send token dropdown with static display when token is locked
All checks were successful
check / check (push) Successful in 17s

When sending from the address-token view, show the token symbol as
plain text instead of a disabled dropdown. ERC-20 tokens include an
etherscan link to the contract address. The dropdown is restored when
navigating back or entering send from other views.
This commit is contained in:
2026-02-27 11:38:42 +07:00
parent a1b181a471
commit fbb0def267
5 changed files with 16 additions and 4 deletions

View File

@@ -398,6 +398,7 @@
> >
<option value="ETH">ETH</option> <option value="ETH">ETH</option>
</select> </select>
<div id="send-token-static" class="text-sm hidden"></div>
</div> </div>
<div class="mb-2"> <div class="mb-2">
<label class="block mb-1">To</label> <label class="block mb-1">To</label>

View File

@@ -309,7 +309,8 @@ function init(_ctx) {
} }
$("send-to").value = ""; $("send-to").value = "";
$("send-amount").value = ""; $("send-amount").value = "";
$("send-token").disabled = false; $("send-token").classList.remove("hidden");
$("send-token-static").classList.add("hidden");
updateSendBalance(); updateSendBalance();
showView("send"); showView("send");
}); });

View File

@@ -338,7 +338,15 @@ function init(ctx) {
} else { } else {
$("send-token").value = tokenId; $("send-token").value = tokenId;
} }
$("send-token").disabled = true; // Hide dropdown, show static token display
$("send-token").classList.add("hidden");
let staticHtml = escapeHtml(currentSymbol);
if (tokenId !== "ETH") {
const link = `https://etherscan.io/token/${tokenId}`;
staticHtml += ` <a href="${link}" target="_blank" rel="noopener" class="inline-flex items-center">${EXT_ICON}</a>`;
}
$("send-token-static").innerHTML = staticHtml;
$("send-token-static").classList.remove("hidden");
updateSendBalance(); updateSendBalance();
showView("send"); showView("send");
}); });

View File

@@ -403,7 +403,8 @@ function init(ctx) {
} }
$("send-to").value = ""; $("send-to").value = "";
$("send-amount").value = ""; $("send-amount").value = "";
$("send-token").disabled = false; $("send-token").classList.remove("hidden");
$("send-token-static").classList.add("hidden");
renderSendTokenSelect(addr); renderSendTokenSelect(addr);
updateSendBalance(); updateSendBalance();
showView("send"); showView("send");

View File

@@ -103,7 +103,8 @@ function init(_ctx) {
}); });
$("btn-send-back").addEventListener("click", () => { $("btn-send-back").addEventListener("click", () => {
$("send-token").disabled = false; $("send-token").classList.remove("hidden");
$("send-token-static").classList.add("hidden");
if (state.selectedToken) { if (state.selectedToken) {
ctx.showAddressToken(); ctx.showAddressToken();
} else { } else {