diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index f09fd80..4c97a61 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -15,6 +15,7 @@ import { DropdownMenuSeparator, } from '@/components/ui/dropdown-menu'; import { LoginArea } from '@/components/auth/LoginArea'; +import { LoginDialog } from '@/components/auth/LoginDialog'; import { SasquatchGuide } from '@/components/SasquatchGuide'; import { useSasquatchGuide } from '@/hooks/useSasquatchGuide'; import { BackupReminder } from '@/components/BackupReminder'; @@ -124,16 +125,21 @@ function MobileHeaderUserMenu({ pubkey, onLogout, onSetStatus, + onAddAccount, }: { pubkey: string; onLogout: () => void; onSetStatus: () => void; + onAddAccount: () => void; }) { const author = useAuthor(pubkey); const metadata = author.data?.metadata; const displayName = metadata?.name ?? genUserName(pubkey); const avatar = metadata?.picture; + // Multi-account: list other logins so the user can switch on mobile. + const { otherUsers, setLogin } = useLoggedInAccounts(); + return ( @@ -225,6 +231,36 @@ function MobileHeaderUserMenu({ Wallet + + {/* ── Accounts: switch between logged-in npubs + add another ── */} + +
+ Accounts +
+ {otherUsers.map((account) => { + const name = account.metadata?.name ?? genUserName(account.pubkey); + return ( + setLogin(account.id)} + className="flex items-center gap-2 cursor-pointer" + > + + + {name.slice(0, 2).toUpperCase()} + + {name} + + ); + })} + + + Add another account + + removeLogin(currentAccount?.id || '')} onSetStatus={() => setShowStatusDialog(true)} + onAddAccount={() => setShowAddAccount(true)} /> ) : ( @@ -986,6 +1024,13 @@ export function Layout({ children, noPadding }: LayoutProps) { onOpenChange={setShowStatusDialog} /> + {/* Add-another-account (multi-account switch on mobile) */} + setShowAddAccount(false)} + onLogin={() => setShowAddAccount(false)} + /> + {/* Newsletter: floating pill + Monday admin reminder */} diff --git a/src/components/NotificationBell.tsx b/src/components/NotificationBell.tsx index 1941528..8e0af54 100644 --- a/src/components/NotificationBell.tsx +++ b/src/components/NotificationBell.tsx @@ -264,8 +264,13 @@ export function NotificationBell({ className }: { className?: string }) { )} - -
+ +

Notifications

@@ -278,8 +283,8 @@ export function NotificationBell({ className }: { className?: string }) {
- - + + - + {/* ─── ALL ─────────────────────────────────────────────────── */} {isLoading && badgeTotal === 0 && ( diff --git a/src/hooks/useDirectMessages.ts b/src/hooks/useDirectMessages.ts index 579d86b..844b722 100644 --- a/src/hooks/useDirectMessages.ts +++ b/src/hooks/useDirectMessages.ts @@ -1,7 +1,7 @@ import { useCallback, useMemo } from 'react'; import { useNostr } from '@nostrify/react'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; -import { nip44, nip19, generateSecretKey, getPublicKey, finalizeEvent } from 'nostr-tools'; +import { nip44, nip19, generateSecretKey, getPublicKey, finalizeEvent, getEventHash } from 'nostr-tools'; import type { NostrEvent } from '@nostrify/nostrify'; import { useNostrLogin } from '@nostrify/react/login';