aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-02 19:47:39 -0700
committerAdam Soltys <[email protected]>2026-08-02 19:47:39 -0700
commit0712c1474b24a858a4650422319fbc9dc8d5427a (patch)
treea9c73805d92281acb6606b3b6274f88b3d652cc3 /src
parent32f2b826e4e962273d75973a99dedbef16d1a6b1 (diff)
downloadcoinosv3-0712c1474b24a858a4650422319fbc9dc8d5427a.tar.gz
coinosv3-0712c1474b24a858a4650422319fbc9dc8d5427a.zip
Profile: copy icon inside the npub box instead of a "Copy key" button
An npub isn't a key — no button, no label; just a small copy glyph right-aligned in the box. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src')
-rw-r--r--src/features/messages.js11
-rw-r--r--src/style.css3
2 files changed, 11 insertions, 3 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index f95c8c7..d74c338 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -48,7 +48,7 @@ const APP_BASE = 'https://v3.coinos.io';
const CACHE_MAX = 50; // messages kept per channel / per DM thread in feature state
export function messagesFeature(ctx) {
- const { h, ui, render, wallet, toast, hook, copyBtn } = ctx;
+ const { h, ui, render, wallet, toast, hook } = ctx;
// ---- persisted state ----------------------------------------------------
@@ -864,8 +864,13 @@ export function messagesFeature(ctx) {
full === undefined
? h('div', { class: 'row gap6', style: 'align-items:center' }, h('span', { class: 'spinner sm' }))
: full.about ? h('p', { class: 'small', style: 'margin:0;white-space:pre-wrap' }, String(full.about).slice(0, 1000)) : null,
- h('div', { class: 'addr-box break', style: 'font-size:11px' }, npub),
- copyBtn(npub, t('copyKey')),
+ h('div', { class: 'addr-box break npub-box', style: 'font-size:11px' },
+ h('span', { class: 'grow', style: 'min-width:0' }, npub),
+ h('button', {
+ class: 'copy-ico', title: t('copy'),
+ onClick: async () => { try { await navigator.clipboard.writeText(npub); toast(t('copied')); } catch {} },
+ html: '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',
+ })),
ui.profEdit
? h('div', { class: 'col', style: 'gap:8px' },
field(t('profName'), 'name'),
diff --git a/src/style.css b/src/style.css
index 2323635..90bb257 100644
--- a/src/style.css
+++ b/src/style.css
@@ -395,3 +395,6 @@ hr.divider { margin: 16px 0; }
.chat-avatar.fallback .punk { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.header-avatar { padding: 0; border: none; background: none; cursor: pointer; display: flex; }
.chat-avatar.header-ava { width: 30px; height: 30px; font-size: 11px; }
+.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); }