video tile fixes

This commit is contained in:
Alejandro Gomez
2023-07-01 18:44:50 +02:00
parent b567a2515e
commit 12345da1e1
4 changed files with 37 additions and 9 deletions

View File

@ -9,9 +9,11 @@ import { StreamState } from "index";
export function VideoTile({
ev,
showAuthor = true,
showStatus = true,
}: {
ev: NostrEvent;
showAuthor?: boolean;
showStatus?: boolean;
}) {
const { inView, ref } = useInView({ triggerOnce: true });
const id = ev.tags.find((a) => a[0] === "d")?.[1]!;
@ -29,13 +31,13 @@ export function VideoTile({
ev.pubkey
);
return (
<Link to={`/${link}`} className="video-tile" ref={ref}>
<Link to={`/live/${link}`} className="video-tile" ref={ref}>
<div
style={{
backgroundImage: `url(${inView ? image : ""})`,
}}
>
<StatePill state={status as StreamState} />
{showStatus && <StatePill state={status as StreamState} />}
</div>
<h3>{title}</h3>
{showAuthor && <div>{inView && <Profile pubkey={host} />}</div>}