From d79ddf374e7dab4f35baaa7ac81710c7c73650e5 Mon Sep 17 00:00:00 2001 From: zmeyer44 Date: Wed, 1 Nov 2023 17:07:11 -0400 Subject: [PATCH] adding uniqby --- .../explore/_sections/ExploreCalendars.tsx | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/(app)/explore/_sections/ExploreCalendars.tsx b/app/(app)/explore/_sections/ExploreCalendars.tsx index e10a25d..b505432 100644 --- a/app/(app)/explore/_sections/ExploreCalendars.tsx +++ b/app/(app)/explore/_sections/ExploreCalendars.tsx @@ -4,14 +4,12 @@ import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { RiArrowRightLine } from "react-icons/ri"; import useEvents from "@/lib/hooks/useEvents"; -import useProfile from "@/lib/hooks/useProfile"; import { nip19 } from "nostr-tools"; -import { EXPLORE_CALENDARS } from "@/constants/app"; -import { getTagValues } from "@/lib/nostr/utils"; -import { NDKEvent, NDKKind, NDKUserProfile } from "@nostr-dev-kit/ndk"; -import { useNDK } from "@nostr-dev-kit/ndk-react"; +import { type NDKKind } from "@nostr-dev-kit/ndk"; +import { uniqBy } from "ramda"; import CalendarCard, { LoadingCalendarCard } from "../_components/CalendarCard"; +import { getTagValues } from "@/lib/nostr/utils"; export default function ExploreCalendars() { return (
@@ -39,14 +37,16 @@ function HorizontalCarousel() { if (events.length) { return (
- {events.map((calendar, index) => ( -
- -
- ))} + {uniqBy((e) => getTagValues("title", e.tags), events).map( + (calendar, index) => ( +
+ +
+ ), + )}
); }