From 0cb461d1236099efa583db6ceb2b8e0798d7edc3 Mon Sep 17 00:00:00 2001 From: zmeyer44 Date: Fri, 20 Oct 2023 20:02:57 -0400 Subject: [PATCH] added alt feed --- app/(app)/(profile)/[npub]/_components/Feed.tsx | 15 +++++++++++++-- app/(app)/(profile)/[npub]/page.tsx | 8 +++++++- app/(app)/app/_sections/LiveStreaming.tsx | 1 - 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/(app)/(profile)/[npub]/_components/Feed.tsx b/app/(app)/(profile)/[npub]/_components/Feed.tsx index 65e71c5..1e752b6 100644 --- a/app/(app)/(profile)/[npub]/_components/Feed.tsx +++ b/app/(app)/(profile)/[npub]/_components/Feed.tsx @@ -1,11 +1,22 @@ import Feed from "@/containers/Feed"; import Spinner from "@/components/spinner"; -export default function ProfileFeed({ pubkey }: { pubkey: string }) { + +export default function ProfileFeed({ + pubkey, + alt, +}: { + pubkey: string; + alt?: string; +}) { + const authors = [pubkey]; + if (alt) { + authors.push(alt); + } return (
( diff --git a/app/(app)/(profile)/[npub]/page.tsx b/app/(app)/(profile)/[npub]/page.tsx index 18c9288..ba1efe2 100644 --- a/app/(app)/(profile)/[npub]/page.tsx +++ b/app/(app)/(profile)/[npub]/page.tsx @@ -15,6 +15,7 @@ import { useModal } from "@/app/_providers/modal/provider"; import useCurrentUser from "@/lib/hooks/useCurrentUser"; import { NDKUser } from "@nostr-dev-kit/ndk"; import MySubscription from "./_components/MySubscription"; +import { getTagValues } from "@/lib/nostr/utils"; const EditProfileModal = dynamic( () => import("@/components/Modals/EditProfile"), { @@ -42,6 +43,7 @@ export default function ProfilePage({ const { currentUser, mySubscription, follows } = useCurrentUser(); const [activeTab, setActiveTab] = useState("feed"); const { type, data } = nip19.decode(npub); + const delegate = getTagValues("delegate", mySubscription?.tags ?? []); if (type !== "npub") { throw new Error("Invalid list"); @@ -157,7 +159,11 @@ export default function ProfilePage({ setActiveTab={(t) => setActiveTab(t.name)} />
- {activeTab === "feed" ? : ""} + {activeTab === "feed" ? ( + + ) : ( + "" + )} {activeTab === "subscriptions" ? : ""} diff --git a/app/(app)/app/_sections/LiveStreaming.tsx b/app/(app)/app/_sections/LiveStreaming.tsx index 21731e3..692bae5 100644 --- a/app/(app)/app/_sections/LiveStreaming.tsx +++ b/app/(app)/app/_sections/LiveStreaming.tsx @@ -24,7 +24,6 @@ export default function LiveStreamingSection() { const { events } = useEvents({ filter: { kinds: [30311 as NDKKind], - // authors: NOTABLE_ACCOUNTS.map((a) => nip19.decode(a).data.toString()), limit: 5, }, });