From 00d9f69ea2c1efbe31b58a784fa29077f8a3e426 Mon Sep 17 00:00:00 2001 From: highperfocused Date: Sat, 22 Nov 2025 01:31:28 +0100 Subject: [PATCH] Add quick link to current user's profile in AccountSwitcher --- src/components/auth/AccountSwitcher.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/auth/AccountSwitcher.tsx b/src/components/auth/AccountSwitcher.tsx index afc655d..4a3b7e5 100644 --- a/src/components/auth/AccountSwitcher.tsx +++ b/src/components/auth/AccountSwitcher.tsx @@ -13,6 +13,8 @@ import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar.tsx' import { WalletModal } from '@/components/WalletModal'; import { useLoggedInAccounts, type Account } from '@/hooks/useLoggedInAccounts'; import { genUserName } from '@/lib/genUserName'; +import { useNavigate } from 'react-router-dom'; +import { nip19 } from 'nostr-tools'; interface AccountSwitcherProps { onAddAccountClick: () => void; @@ -20,7 +22,8 @@ interface AccountSwitcherProps { export function AccountSwitcher({ onAddAccountClick }: AccountSwitcherProps) { const { currentUser, otherUsers, setLogin, removeLogin } = useLoggedInAccounts(); - + const navigate = useNavigate(); + if (!currentUser) return null; const getDisplayName = (account: Account): string => { @@ -42,6 +45,20 @@ export function AccountSwitcher({ onAddAccountClick }: AccountSwitcherProps) { + {/* Profile quick link */} + navigate(`/${nip19.npubEncode(currentUser.pubkey)}`)} + > + + + {getDisplayName(currentUser).charAt(0)} + +
+

{getDisplayName(currentUser)}

+
+
+
Switch Account
{otherUsers.map((user) => (