diff --git a/src/App.tsx b/src/App.tsx index f17cd10..dc4db69 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import { Feed } from "./components/feed/Feed"; import { RelaysView } from "./components/shared/RelaysView"; import { SettingsView } from "./components/shared/SettingsView"; import { ProfileView } from "./components/profile/ProfileView"; +import { ThreadView } from "./components/thread/ThreadView"; import { useUIStore } from "./stores/ui"; function App() { @@ -16,6 +17,7 @@ function App() { {currentView === "relays" && } {currentView === "settings" && } {currentView === "profile" && } + {currentView === "thread" && } ); diff --git a/src/components/feed/NoteCard.tsx b/src/components/feed/NoteCard.tsx index 9872eb1..553bf34 100644 --- a/src/components/feed/NoteCard.tsx +++ b/src/components/feed/NoteCard.tsx @@ -19,7 +19,7 @@ export function NoteCard({ event }: NoteCardProps) { const time = event.created_at ? timeAgo(event.created_at) : ""; const { loggedIn } = useUserStore(); - const { openProfile } = useUIStore(); + const { openProfile, openThread, currentView } = useUIStore(); const likedKey = "wrystr_liked"; const getLiked = () => { try { return new Set(JSON.parse(localStorage.getItem(likedKey) || "[]")); } @@ -109,7 +109,12 @@ export function NoteCard({ event }: NoteCardProps) { {time} - +
openThread(event, currentView as "feed" | "profile")} + > + +
{/* Actions */} {loggedIn && ( diff --git a/src/components/profile/ProfileView.tsx b/src/components/profile/ProfileView.tsx index e89d81d..a510a31 100644 --- a/src/components/profile/ProfileView.tsx +++ b/src/components/profile/ProfileView.tsx @@ -7,7 +7,7 @@ import { shortenPubkey } from "../../lib/utils"; import { NoteCard } from "../feed/NoteCard"; export function ProfileView() { - const { selectedPubkey, setView } = useUIStore(); + const { selectedPubkey, goBack } = useUIStore(); const pubkey = selectedPubkey!; const profile = useProfile(pubkey); @@ -33,7 +33,7 @@ export function ProfileView() { {/* Header */}
+

Thread

+
+ +
+ {/* Root note */} + + + {/* Reply composer */} + {loggedIn && ( +
+