Write on the margins of the internet. Powered by the AT Protocol.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add all page within profile

+16 -5
+16 -5
web/src/views/profile/Profile.tsx
··· 61 61 did: string; 62 62 } 63 63 64 - type Tab = "annotations" | "highlights" | "bookmarks" | "collections"; 64 + type Tab = "all" | "annotations" | "highlights" | "bookmarks" | "collections"; 65 65 66 66 export default function Profile({ did }: ProfileProps) { 67 67 const [profile, setProfile] = useState<UserProfile | null>(null); 68 68 const [loading, setLoading] = useState(true); 69 - const [activeTab, setActiveTab] = useState<Tab>("annotations"); 69 + const [activeTab, setActiveTab] = useState<Tab>("all"); 70 70 71 + const [all, setAll] = useState<AnnotationItem[]>([]); 71 72 const [annotations, setAnnotations] = useState<AnnotationItem[]>([]); 72 73 const [highlights, setHighlights] = useState<AnnotationItem[]>([]); 73 74 const [bookmarks, setBookmarks] = useState<AnnotationItem[]>([]); ··· 116 117 117 118 useEffect(() => { 118 119 setProfile(null); 120 + setAll([]); 119 121 setAnnotations([]); 120 122 setHighlights([]); 121 123 setBookmarks([]); 122 124 setCollections([]); 123 - setActiveTab("annotations"); 125 + setActiveTab("all"); 124 126 setLoading(true); 125 127 126 128 const loadProfile = async () => { ··· 188 190 189 191 setDataLoading(true); 190 192 try { 191 - if (activeTab === "annotations") { 193 + if (activeTab === "all") { 194 + const res = await getFeed({ 195 + creator: resolvedDid, 196 + limit: 50, 197 + }); 198 + setAll(res.items || []); 199 + } else if (activeTab === "annotations") { 192 200 const res = await getFeed({ 193 201 creator: resolvedDid, 194 202 motivation: "commenting", ··· 254 262 } 255 263 256 264 const tabs = [ 265 + { id: "all", label: "All" }, 257 266 { id: "annotations", label: "Annotations" }, 258 267 { id: "highlights", label: "Highlights" }, 259 268 { id: "bookmarks", label: "Bookmarks" }, ··· 265 274 ? annotations 266 275 : activeTab === "highlights" 267 276 ? highlights 268 - : bookmarks; 277 + : activeTab === "all" 278 + ? all 279 + : bookmarks; 269 280 270 281 const LABEL_DESCRIPTIONS: Record<string, string> = { 271 282 sexual: "Sexual Content",