From 6a7f57c8e0b9c3d2339f8258ff2e349533daaccc Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 4 Aug 2026 01:38:27 -0700 Subject: Choosing a name gets a page of its own MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pencil opens a dedicated screen — no balances, no tabs — wired into the history stack like the other sub-pages. Co-Authored-By: Claude Fable 5 --- src/features/names.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/features') diff --git a/src/features/names.js b/src/features/names.js index d26a654..0f37658 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -23,7 +23,7 @@ const DOMAIN = 'coinos.io'; const AUTH_KIND = 21353; export function namesFeature(ctx) { - const { h, ui, render, wallet, hook, toast, copyBtn } = ctx; + const { h, ui, render, wallet, hook, toast, copyBtn, brandHeader, goBack } = ctx; // The wallet's own key signs registrar requests: it's the one key that is // always available — offline, in the background, with no signer attached. @@ -314,12 +314,9 @@ export function namesFeature(ctx) { // the pen is how you change the name — right where the name is h('button', { class: 'addr-edit', title: t('namesCustom'), - onClick: () => { ui.nameEditOpen = !ui.nameEditOpen; ui.nameClaimError = null; render(); }, + onClick: () => { ui.nameEditOpen = true; ui.nameClaimError = null; render(); }, html: '', })), - ui.nameEditOpen ? h('div', { class: 'col', style: 'gap:8px;width:100%' }, - h('p', { class: 'small muted', style: 'margin:0' }, t('namesCustomHow')), - claimForm(false)) : null, copyBtn(addr, t('namesCopy')), offerSection()); } @@ -396,6 +393,21 @@ export function namesFeature(ctx) { return { id: 'names', init() { checked = false; lastError = null; refresh(); }, + // The pencil by the address opens this: choosing a name gets a page of + // its own — no balances, no tabs, just the name. + screenView() { + if (ui.screen !== 'wallet' || !ui.nameEditOpen) return null; + const st = load(); + const addr = st.name ? `${st.name}@${st.domain || DOMAIN}` : null; + return h('div', { class: 'col', style: 'gap:16px' }, + brandHeader(false), + h('div', { class: 'card col' }, + h('h3', {}, t('namesCustom')), + addr ? h('div', { class: 'addr-box break', style: 'font-size:14px' }, addr) : null, + h('p', { class: 'small muted', style: 'margin:0' }, t('namesCustomHow')), + claimForm(true)), + h('button', { class: 'btn-ghost btn-block', onClick: () => goBack(() => { ui.nameEditOpen = null; ui.nameClaimError = null; }) }, t('back'))); + }, namesAdoptIdentity(signer, npub) { return adoptIdentity(signer, npub); }, // the claimed payment address, for anyone prefilling a lightning address namesAddress() { const st = load(); return st.name ? `${st.name}@${st.domain || DOMAIN}` : null; }, -- cgit v1.2.3