diff options
| author | Adam Soltys <[email protected]> | 2026-08-02 19:50:54 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-02 19:50:54 -0700 |
| commit | 5f4a802b28e23ea6e08d2cf703698f2f48f26199 (patch) | |
| tree | 6ad7d9eb808fa209d2831005e93210761083afdc /src/app.js | |
| parent | 0712c1474b24a858a4650422319fbc9dc8d5427a (diff) | |
| download | coinosv3-5f4a802b28e23ea6e08d2cf703698f2f48f26199.tar.gz coinosv3-5f4a802b28e23ea6e08d2cf703698f2f48f26199.zip | |
Settings: a hub of five subpages
The main page is just doors — Wallet (name, public key, recovery
phrase), Payments (payment address + Spending status), Network (chain +
data source), Nostr, Advanced. Every subpage keeps its own back button
and rides browser history via the existing settingsPage nav field.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 30 |
1 files changed, 20 insertions, 10 deletions
@@ -1419,21 +1419,31 @@ function addressScanView() { ); } +// Settings is a hub: the main page is nothing but doors, each subpage owns +// one concern — Wallet (name/pubkey/seed), Payments (address + Spending), +// Network (chain + data source), Nostr, Advanced (rarities). function settingsTab() { if (ui.addrScan && !wallet.offline) return addressScanView(); - if (ui.settingsPage === 'advanced') return advancedSettingsView(); - if (ui.settingsPage === 'nostr') return nostrSettingsView(); const a = activeAccount(); + const page = (kids) => h('div', { class: 'col', style: 'gap:16px' }, ...kids, + h('button', { class: 'btn-ghost btn-block', onClick: () => { ui.settingsPage = null; render(); } }, t('back'))); + switch (ui.settingsPage) { + case 'wallet': return page(a ? [walletNameCard(a), pubkeyCard(a), recoveryCard(a)] : []); + case 'payments': return page(featureAll('settingsCards').reverse()); + case 'network': return page([networkCard(), explorerCard()]); + case 'nostr': return nostrSettingsView(); + case 'advanced': return advancedSettingsView(); + } + const nav = (id, label) => + h('button', { class: 'btn-block settings-nav', onClick: () => { ui.settingsPage = id; render(); } }, label); return h( 'div', - { class: 'col', style: 'gap:16px' }, - // The active wallet's own settings, inlined (auto-logout lives in Advanced). - ...(a ? [walletNameCard(a), pubkeyCard(a), recoveryCard(a)] : []), - ...featureAll('settingsCards'), - networkCard(), - explorerCard(), - h('button', { class: 'btn-ghost btn-block', onClick: () => { ui.settingsPage = 'nostr'; render(); } }, t('nostrSettings')), - h('button', { class: 'btn-ghost btn-block', onClick: () => { ui.settingsPage = 'advanced'; render(); } }, t('advancedSettings')) + { class: 'col', style: 'gap:10px' }, + nav('wallet', t('settingsWallet')), + nav('payments', t('settingsPayments')), + nav('network', t('settingsNetwork')), + nav('nostr', t('nostrSettings')), + nav('advanced', t('advancedSettings')) ); } |
