v2: global player, infinite scroll, image picker, threaded comments

This commit is contained in:
khannurien
2026-03-21 13:55:22 +00:00
parent be426eb150
commit 7c098e7c4c
48 changed files with 4346 additions and 711 deletions

View File

@@ -4,6 +4,7 @@ import { relativeTime } from "../utils/relativeTime.ts";
import FilePreview from "./FilePreview.tsx";
import RichContentCard from "./RichContentCard.tsx";
import { VoteButton } from "./VoteButton.tsx";
import { Markdown } from "./Markdown.tsx";
interface DumpCardProps {
dump: Dump;
@@ -13,10 +14,11 @@ interface DumpCardProps {
castVote: (id: string) => void;
removeVote: (id: string) => void;
className?: string;
isOwner?: boolean;
}
export function DumpCard(
{ dump, voteCount, voted, canVote, castVote, removeVote, className }:
{ dump, voteCount, voted, canVote, castVote, removeVote, className, isOwner }:
DumpCardProps,
) {
const navigate = useNavigate();
@@ -46,14 +48,26 @@ export function DumpCard(
>
{dump.title}
</Link>
{dump.comment && <p className="dump-card-comment">{dump.comment}</p>}
<time
className="dump-card-date"
dateTime={dump.createdAt.toISOString()}
title={dump.createdAt.toLocaleString()}
>
{relativeTime(dump.createdAt)}
</time>
{dump.comment && (
<Markdown className="dump-card-comment" inline>{dump.comment}</Markdown>
)}
<div className="dump-card-meta">
<time
className="dump-card-date"
dateTime={dump.createdAt.toISOString()}
title={dump.createdAt.toLocaleString()}
>
{relativeTime(dump.createdAt)}
</time>
{dump.commentCount > 0 && (
<span className="dump-card-comment-count">
{dump.commentCount} {dump.commentCount === 1 ? "comment" : "comments"}
</span>
)}
{dump.isPrivate && isOwner && (
<span className="dump-card-private-badge">private</span>
)}
</div>
</div>
<div className="dump-card-vote" onClick={(e) => e.stopPropagation()}>