Files
lumina/components/TagQuickViewFeed.tsx
Silberengel 525a0850b1 Upload from url PART 2 (#139)
* add URL option to image upload

* Full NIP-68 and NIP-71 implementation

* changed deprecated note ids to nevent ids, with backward-compatability

* interim state reels implementation

* Fixed uploading from URL and added a Cancel button to the upload modal. Couldn't get rid of the errors.

* Added ability to upload kinds 20, 21, 22, along with source tags (e, a, or u). Includes validation check.

* added thumbnail support

* included kind 21 and kind 22 in the feeds and searches

* Implement inboxes/outboxes

* implemented thumbnails in the profile feed

* enhanced reels feed with #reels

* interim implementation of pins

* added pins

* fixed the pins

* tidied up the reels

* fixed the uploader

* Fixed build

* update reels feed with the one from Lumina main

* fixed the reels interactions

* Added audio controls

* Interim reelfeed state

* feed working again

* full fead

---------

Co-authored-by: Silberengel <silberengel7@proton.com>
2025-09-01 23:05:54 +02:00

71 lines
2.3 KiB
TypeScript

import { useRef, useState } from "react";
import { useNostrEvents } from "nostr-react";
import { getImageUrl } from "@/utils/utils";
import QuickViewKind20NoteCard from "./QuickViewKind20NoteCard";
import { Skeleton } from "@/components/ui/skeleton";
import { Button } from "@/components/ui/button";
interface TagQuickViewFeedProps {
tag: string;
}
const TagQuickViewFeed: React.FC<TagQuickViewFeedProps> = ({ tag }) => {
const now = useRef(new Date()); // Make sure current time isn't re-rendered
const [limit, setLimit] = useState(25);
const { events, isLoading } = useNostrEvents({
filter: {
// since: dateToUnix(now.current), // all new events from now
// since: 0,
limit: limit,
kinds: [20, 21, 22],
"#t": [tag],
},
});
const loadMore = () => {
setLimit(prevLimit => prevLimit + 25);
};
return (
<>
<div className="grid grid-cols-3 gap-2">
{events.length === 0 && isLoading ? (
<>
<div className="aspect-square w-full">
<Skeleton className="h-full w-full rounded-xl" />
</div>
<div className="aspect-square w-full">
<Skeleton className="h-full w-full rounded-xl" />
</div>
<div className="aspect-square w-full">
<Skeleton className="h-full w-full rounded-xl" />
</div>
<div className="aspect-square w-full">
<Skeleton className="h-full w-full rounded-xl" />
</div>
<div className="aspect-square w-full">
<Skeleton className="h-full w-full rounded-xl" />
</div>
<div className="aspect-square w-full">
<Skeleton className="h-full w-full rounded-xl" />
</div>
</>
) : (
events.map((event) => (
<div key={event.id}>
<QuickViewKind20NoteCard pubkey={event.pubkey} text={event.content} image={getImageUrl(event.tags)} eventId={event.id} tags={event.tags} event={event} linkToNote={true} />
</div>
))
)}
</div>
{!isLoading && (
<div className="flex justify-center p-4">
<Button className="w-full md:w-auto" onClick={loadMore}>Load More</Button>
</div>
)}
</>
);
}
export default TagQuickViewFeed;