aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.js30
-rw-r--r--src/i18n.js7
-rw-r--r--src/style.css2
3 files changed, 27 insertions, 12 deletions
diff --git a/src/app.js b/src/app.js
index 7e9d9e8..3a19573 100644
--- a/src/app.js
+++ b/src/app.js
@@ -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'))
);
}
diff --git a/src/i18n.js b/src/i18n.js
index 9f23b14..12fe514 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -201,8 +201,11 @@ const STR = {
msgInviteSent: 'Invite sent',
msgLeave: 'Leave community',
msgLeaveConfirm: 'Really leave? Rejoining needs a new invite',
- nostrSettings: 'Nostr settings',
- advancedSettings: 'Advanced settings',
+ nostrSettings: 'Nostr',
+ settingsWallet: 'Wallet',
+ settingsPayments: 'Payments',
+ settingsNetwork: 'Network',
+ advancedSettings: 'Advanced',
recoveryDesc: 'The twelve words that back up this wallet. Anyone who sees them can steal your funds.',
arkOffboardAmtPlaceholder: 'Amount',
arkSplitting: 'Carving out that exact amount — this can take a minute…',
diff --git a/src/style.css b/src/style.css
index 90bb257..2bd18f4 100644
--- a/src/style.css
+++ b/src/style.css
@@ -398,3 +398,5 @@ hr.divider { margin: 16px 0; }
.npub-box { display: flex; align-items: center; gap: 8px; }
.copy-ico { flex-shrink: 0; background: none; border: none; padding: 2px; color: var(--muted); cursor: pointer; display: flex; }
.copy-ico:hover { color: var(--ink); }
+.settings-nav { text-align: left; font-weight: 600; padding: 14px 16px; position: relative; }
+.settings-nav::after { content: '›'; position: absolute; right: 16px; color: var(--faint); font-weight: 400; }