mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-04-11 07:56:47 +02:00
* 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>
90 lines
2.6 KiB
TypeScript
90 lines
2.6 KiB
TypeScript
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";
|
|
|
|
interface FollowerQuickViewFeedProps {
|
|
pubkey: string;
|
|
}
|
|
|
|
const FollowerQuickViewFeed: React.FC<FollowerQuickViewFeedProps> = ({ pubkey }) => {
|
|
const now = useRef(new Date()); // Make sure current time isn't re-rendered
|
|
const [limit, setLimit] = useState(25);
|
|
|
|
const { events: following, isLoading: followingLoading } = useNostrEvents({
|
|
filter: {
|
|
kinds: [3],
|
|
authors: [pubkey],
|
|
limit: 1,
|
|
},
|
|
});
|
|
|
|
let followingPubkeys = following.flatMap((event) =>
|
|
event.tags
|
|
.filter(tag => tag[0] === 'p')
|
|
.map(tag => tag[1])
|
|
);
|
|
|
|
const { events, isLoading } = useNostrEvents({
|
|
filter: {
|
|
limit: limit,
|
|
kinds: [20, 21, 22],
|
|
authors: followingPubkeys,
|
|
},
|
|
});
|
|
|
|
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) => (
|
|
<QuickViewKind20NoteCard
|
|
key={event.id}
|
|
pubkey={event.pubkey}
|
|
text={event.content}
|
|
image={getImageUrl(event.tags)}
|
|
event={event}
|
|
tags={event.tags}
|
|
eventId={event.id}
|
|
linkToNote={true}
|
|
/>
|
|
))
|
|
)}
|
|
</div>
|
|
{!isLoading && (
|
|
<div className="flex justify-center p-4">
|
|
<Button className="w-full md:w-auto" onClick={loadMore}>Load More</Button>
|
|
</div>
|
|
)}
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default FollowerQuickViewFeed; |