aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js
index fdbe8f4..f2f9ee3 100644
--- a/src/app.js
+++ b/src/app.js
@@ -1448,6 +1448,23 @@ function avatarMenu() {
: null; })());
}
+// Messages sit one tap away, left of the wallet selector. The dot is presence,
+// not a count — it says "someone's waiting", and the chat list says who.
+function messagesBtn() {
+ const me = (featureHook('nostrLoginIdentity') || {}).pubkey || (wallet.nostrPubkey && wallet.nostrPubkey());
+ if (!me) return null;
+ const unread = featureHook('unreadMessages') || 0;
+ return h('button', {
+ class: 'header-msgs' + (unread ? ' unread' : ''),
+ title: t('msgDmsTitle'),
+ 'aria-label': t('msgDmsTitle'),
+ onClick: () => { ui.profilePk = null; ui.chatOpen = true; ui.msgView = 'home'; render(); },
+ }, h('span', {
+ class: 'hm-ico',
+ html: '<svg width="21" height="21" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/></svg>',
+ }));
+}
+
function brandHeader(withLock) {
const acc = activeAccount();
return h(
@@ -1460,6 +1477,7 @@ function brandHeader(withLock) {
),
withLock
? h('div', { class: 'row gap6', style: 'align-items:center' },
+ messagesBtn(),
h('button', { class: 'btn-sm', onClick: () => { ui.screen = 'accounts'; render(); } },
acc ? acc.label : t('accounts')),
avatarMenu())