mirror of
https://github.com/hoornet/vega.git
synced 2026-05-07 12:49:13 -07:00
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:
@@ -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 })),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user