Set compose modal title to 'Share to feed' when sharing external content

This commit is contained in:
Chad Curtis
2026-02-28 21:26:49 -06:00
parent 38c7e00ca9
commit 930a64d965
2 changed files with 5 additions and 2 deletions
+4 -2
View File
@@ -29,6 +29,8 @@ interface ReplyComposeModalProps {
onSuccess?: () => void;
/** Pre-filled content for the compose box. */
initialContent?: string;
/** Override the modal title. */
title?: string;
}
/** Extracts image URLs from note content. */
@@ -37,14 +39,14 @@ function extractImages(content: string): string[] {
return content.match(urlRegex) || [];
}
export function ReplyComposeModal({ event, quotedEvent, open, onOpenChange, onSuccess, initialContent }: ReplyComposeModalProps) {
export function ReplyComposeModal({ event, quotedEvent, open, onOpenChange, onSuccess, initialContent, title: titleOverride }: ReplyComposeModalProps) {
const isUrl = event instanceof URL;
const isReply = !!event;
const isQuote = !!quotedEvent;
const [previewMode, setPreviewMode] = useState(false);
const [hasPreviewableContent, setHasPreviewableContent] = useState(false);
const title = isUrl ? 'New comment' : isReply ? 'Reply to post' : isQuote ? 'Quote post' : 'New post';
const title = titleOverride ?? (isUrl ? 'New comment' : isReply ? 'Reply to post' : isQuote ? 'Quote post' : 'New post');
const placeholder = isUrl ? 'Write a comment...' : isReply ? "What's on your mind?" : isQuote ? 'Add a comment...' : "What's happening?";
return (
+1
View File
@@ -192,6 +192,7 @@ function ExternalActionBar({ content }: { content: ExternalContent }) {
open={shareOpen}
onOpenChange={setShareOpen}
initialContent={identifier}
title="Share to feed"
/>
</div>
);