Add profile view with clickable names/avatars

- ProfileView shows avatar, bio, nip05, website, recent notes
- Clicking any name or avatar navigates to their profile
- Add fetchUserNotes to nostr lib (kind 1 by author)
- Add openProfile action + selectedPubkey to UI store
- Back button returns to feed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jure
2026-03-08 18:48:05 +01:00
parent 65f10c81b1
commit 5879a640df
6 changed files with 137 additions and 6 deletions

View File

@@ -1,17 +1,21 @@
import { create } from "zustand";
type View = "feed" | "relays" | "settings";
type View = "feed" | "relays" | "settings" | "profile";
interface UIState {
currentView: View;
sidebarCollapsed: boolean;
selectedPubkey: string | null;
setView: (view: View) => void;
openProfile: (pubkey: string) => void;
toggleSidebar: () => void;
}
export const useUIStore = create<UIState>((set) => ({
currentView: "feed",
sidebarCollapsed: false,
selectedPubkey: null,
setView: (currentView) => set({ currentView }),
openProfile: (pubkey) => set({ currentView: "profile", selectedPubkey: pubkey }),
toggleSidebar: () => set((s) => ({ sidebarCollapsed: !s.sidebarCollapsed })),
}));