diff options
| author | Adam Soltys <[email protected]> | 2026-08-16 00:38:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-16 00:38:49 -0700 |
| commit | f23a0488854a58bea8c0cb2ddc8e1c424a6828f4 (patch) | |
| tree | a773b37ab693e70cd1cb54a81eed598a266d0e3c /src/recipient-search.js | |
| parent | b3e3468579c7ea996cd8da6fa3cc4ff9004cfa32 (diff) | |
| download | coinosv3-f23a0488854a58bea8c0cb2ddc8e1c424a6828f4.tar.gz coinosv3-f23a0488854a58bea8c0cb2ddc8e1c424a6828f4.zip | |
Hats: put your money where your head is — supporter hats perch above the avatar everywhere it appears, from 21-sat beanie to 2.1M-sat top hat; the crown stays on the founder
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src/recipient-search.js')
| -rw-r--r-- | src/recipient-search.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/recipient-search.js b/src/recipient-search.js index 5b7758b..bd1767b 100644 --- a/src/recipient-search.js +++ b/src/recipient-search.js @@ -220,15 +220,17 @@ export function makeSearcher(onUpdate) { // Candidate rows (avatar + name + address/npub), styled with the chat list // classes both pages already ship. -export function resultRows(h, rows, onPick) { - return rows.map((r) => - h('div', { class: 'item chat-thread-row', onClick: () => onPick(r) }, - r.picture - // background, not <img>: paints synchronously from cache, so rows - // re-rendered per keystroke don't flash their avatars - ? h('div', { class: 'chat-avatar ava-img', style: `background-image:url(${JSON.stringify(r.picture)})` }) - : fallbackAvatar(h, r.pk, r.name, 'chat-avatar'), +export function resultRows(h, rows, onPick, wrapAvatar) { + return rows.map((r) => { + const ava = r.picture + // background, not <img>: paints synchronously from cache, so rows + // re-rendered per keystroke don't flash their avatars + ? h('div', { class: 'chat-avatar ava-img', style: `background-image:url(${JSON.stringify(r.picture)})` }) + : fallbackAvatar(h, r.pk, r.name, 'chat-avatar'); + return h('div', { class: 'item chat-thread-row', onClick: () => onPick(r) }, + (wrapAvatar && wrapAvatar(r.pk, ava)) || ava, h('div', { class: 'col grow', style: 'min-width:0;gap:1px' }, h('div', { class: 'chat-name' }, r.name || (npubOf(r.pk) || '').slice(0, 12)), - h('div', { class: 'muted small chat-preview' }, r.address || r.nip05 || (npubOf(r.pk) || '').slice(0, 24) + '…')))); + h('div', { class: 'muted small chat-preview' }, r.address || r.nip05 || (npubOf(r.pk) || '').slice(0, 24) + '…'))); + }); } |
