From 80be2c0197a7b42996b9a806b5a53030f4f320ba Mon Sep 17 00:00:00 2001 From: zmeyer44 Date: Thu, 2 Nov 2023 09:14:30 -0400 Subject: [PATCH] cleanup --- .../explore/_sections/ExploreCalendars.tsx | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/app/(app)/explore/_sections/ExploreCalendars.tsx b/app/(app)/explore/_sections/ExploreCalendars.tsx index 3730816..43f2972 100644 --- a/app/(app)/explore/_sections/ExploreCalendars.tsx +++ b/app/(app)/explore/_sections/ExploreCalendars.tsx @@ -5,7 +5,7 @@ import { Button } from "@/components/ui/button"; import { RiArrowRightLine } from "react-icons/ri"; import useEvents from "@/lib/hooks/useEvents"; import { nip19 } from "nostr-tools"; -import { type NDKKind } from "@nostr-dev-kit/ndk"; +import { NDKEvent, type NDKKind } from "@nostr-dev-kit/ndk"; import { uniqBy } from "ramda"; import CalendarCard, { LoadingCalendarCard } from "../_components/CalendarCard"; @@ -45,7 +45,7 @@ function HorizontalCarousel() { key={calendar.id} className={cn("snap-start pl-2 sm:pl-5", index === 0 && "pl-5")} > - + ), )} @@ -67,24 +67,6 @@ function HorizontalCarousel() { ); } -function Calendar({ encodedEvent }: { encodedEvent: string }) { - const { type, data } = nip19.decode(encodedEvent); - if (type !== "naddr") { - throw new Error("impoper type"); - } - const { pubkey, identifier, kind } = data; - const { events } = useEvents({ - filter: { - authors: [pubkey], - ["#d"]: [identifier], - kinds: [31924 as NDKKind], - limit: 1, - }, - }); - const event = events[0]; - if (!event) { - return null; - } - - return ; +function Calendar({ event }: { event: NDKEvent }) { + return ; }