a18hvcryt: Delete the signed-in person's own post from its menu

This commit is contained in:
2026-10-19 14:32:06 -06:00
parent 5a33546af2
commit 0861663bea
14 changed files with 383 additions and 8 deletions
+10 -1
View File
@@ -1,5 +1,5 @@
import type { Ref } from "react";
import type { CardPost } from "@/lib/feed-model";
import { canDelete, type CardPost } from "@/lib/feed-model";
import { Composer, type ComposerProps } from "./Composer";
import { PostCard } from "./PostCard";
@@ -17,6 +17,11 @@ export interface FeedViewProps {
likeBusy?: ReadonlySet<string>;
likeErrors?: ReadonlySet<string>;
onSignedOut?: () => void;
/** The signed-in person's feed user id; delete is offered only on their own posts. */
feedUserId?: string | null;
onDelete?: (post: CardPost) => void;
deleteBusy?: ReadonlySet<string>;
deleteErrors?: ReadonlySet<string>;
composer?: ComposerProps;
sentinelRef?: Ref<HTMLDivElement>;
now?: number;
@@ -65,6 +70,10 @@ export function FeedView(p: FeedViewProps) {
likeBusy={p.likeBusy?.has(post.key)}
likeError={p.likeErrors?.has(post.key)}
onSignedOut={p.onSignedOut}
canDelete={canDelete(post, p.feedUserId)}
onDelete={p.onDelete}
deleteBusy={p.deleteBusy?.has(post.key)}
deleteError={p.deleteErrors?.has(post.key)}
/>)
)}
{p.loadMoreFailed ? (