diff --git a/app/global/page.tsx b/app/global/page.tsx index d019ba2..6e66668 100644 --- a/app/global/page.tsx +++ b/app/global/page.tsx @@ -1,6 +1,9 @@ "use client"; import GlobalFeed from "@/components/GlobalFeed"; +import GlobalQuickViewFeed from "@/components/GlobalQuickViewFeed"; +import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs"; +import { GridIcon, SectionIcon } from "@radix-ui/react-icons"; import { useEffect } from "react"; export default function GlobalFeedPage() { @@ -11,7 +14,19 @@ export default function GlobalFeedPage() { return (
- +

Global Feed

+ + + + + + + + + + + +
); } diff --git a/components/GlobalFeed.tsx b/components/GlobalFeed.tsx index 99ea636..c559c48 100644 --- a/components/GlobalFeed.tsx +++ b/components/GlobalFeed.tsx @@ -21,7 +21,6 @@ const GlobalFeed: React.FC = () => { return ( <> -

Global Feed

{events.map((event) => { const imageUrl = getImageUrl(event.tags); diff --git a/components/GlobalQuickViewFeed.tsx b/components/GlobalQuickViewFeed.tsx new file mode 100644 index 0000000..c10f692 --- /dev/null +++ b/components/GlobalQuickViewFeed.tsx @@ -0,0 +1,72 @@ +import { useRef, useState } from "react"; +import { useNostrEvents } from "nostr-react"; +import { Skeleton } from "@/components/ui/skeleton"; +import { Button } from "@/components/ui/button"; +import QuickViewKind20NoteCard from "./QuickViewKind20NoteCard"; +import { getImageUrl } from "@/utils/utils"; + +const GlobalQuickViewFeed: React.FC = () => { + const now = useRef(new Date()); + const [limit, setLimit] = useState(25); + + const { events, isLoading } = useNostrEvents({ + filter: { + limit: limit, + kinds: [20], + since: Math.floor((now.current.getTime() - 24 * 60 * 60 * 1000) / 1000), // Last 24 hours + }, + }); + + const loadMore = () => { + setLimit(prevLimit => prevLimit + 25); + }; + + return ( + <> +
+ {events.length === 0 && isLoading ? ( + <> +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + ) : ( + events.map((event) => ( + + )) + )} +
+ {!isLoading && ( +
+ +
+ )} + + ); +} + +export default GlobalQuickViewFeed; \ No newline at end of file