From 74d84cb2f22600b6246343e9ea606cf0db7517f0 Mon Sep 17 00:00:00 2001 From: polwex Date: Wed, 19 Nov 2025 05:47:30 +0700 Subject: Big GUI improvements on Nostr rendering and fetching --- gui/src/pages/Feed.tsx | 56 +++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 37 deletions(-) (limited to 'gui/src/pages/Feed.tsx') diff --git a/gui/src/pages/Feed.tsx b/gui/src/pages/Feed.tsx index bb001d4..16a5ea1 100644 --- a/gui/src/pages/Feed.tsx +++ b/gui/src/pages/Feed.tsx @@ -8,13 +8,13 @@ import { useState } from "react"; import Composer from "@/components/composer/Composer"; import { ErrorPage } from "@/pages/Error"; import NostrFeed from "@/components/nostr/Feed"; +import { consolidateFeeds, disaggregate } from "@/logic/nostrill"; -type FeedType = "global" | "following" | "nostr"; +type FeedType = "urbit" | "following" | "nostr"; function Loader() { const params = useParams(); - console.log({ params }); if (!params.taip) return ; - if (params.taip === "global") return ; + // if (params.taip === "urbit") return ; if (params.taip === "following") return ; if (params.taip === "nostr") return ; // else if (param === FeedType.Rumors) return ; @@ -27,10 +27,10 @@ function FeedPage({ t }: { t: FeedType }) { <>
setActive("global")} + className={active === "urbit" ? "active" : ""} + onClick={() => setActive("urbit")} > - Global + Urbit
- {active === "global" ? ( - + {active === "urbit" ? ( + ) : active === "following" ? ( ) : active === "nostr" ? ( @@ -58,40 +58,22 @@ function FeedPage({ t }: { t: FeedType }) { ); } -// {active === "global" ? ( -// -// ) : active === "following" ? ( -// -// ) : ( -// -// )} -function Global() { - // const { api } = useLocalState(); - // const { isPending, data, refetch } = useQuery({ - // queryKey: ["globalFeed"], - // queryFn: () => { - // return api!.scryFeed(null, null); - // }, - // }); - // console.log(data, "scry feed data"); - // if (isPending) return ; - // else if ("bucun" in data) return

Error

; - // else return ; - return

Error

; +function Urbit() { + const following = useLocalState((s) => s.following); + const feed = disaggregate(following, "urbit"); + return ( +
+ {}} /> +
+ ); } function Following() { - const following = useLocalState((s) => s.following2); - console.log({ following }); - - // console.log(data, "scry feed data"); - // if (isPending) return ; - // else if ("bucun" in data) return

Error

; - // else return ; - + const following = useLocalState((s) => s.following); + const feed = consolidateFeeds(following); return (
- {}} /> + {}} />
); } -- cgit v1.2.3