From 38185e43b36c6990e55eda8e9f68371176e9bf48 Mon Sep 17 00:00:00 2001 From: nmemmert Date: Wed, 22 Jul 2026 13:02:54 -0400 Subject: [PATCH] Remove dead shareToX/shareToFacebook functions and related state; v1.0.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes CI lint errors — both functions were replaced by shareImageTo in the previous commit but not deleted. Co-Authored-By: Claude Sonnet 4.6 --- src/components/QASection.tsx | 47 ++---------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/src/components/QASection.tsx b/src/components/QASection.tsx index bfed529..eea0c37 100644 --- a/src/components/QASection.tsx +++ b/src/components/QASection.tsx @@ -391,7 +391,6 @@ export default function QASection() { const [engagement, setEngagement] = useState({}) const [expandedCompactAnswers, setExpandedCompactAnswers] = useState>({}) const [copiedQuestionId, setCopiedQuestionId] = useState(null) - const [copiedFacebookCaptionId, setCopiedFacebookCaptionId] = useState(null) const [loading, setLoading] = useState(true) const [votedIds, setVotedIds] = useState>(() => { try { @@ -746,45 +745,6 @@ export default function QASection() { } } - const shareToX = (question: DecoratedQuestion) => { - const url = getSocialUrl(question.id) - const text = question.question.length > 200 - ? `${question.question.slice(0, 197)}…` - : question.question - window.open( - `https://x.com/intent/tweet?text=${encodeURIComponent(text)}&url=${encodeURIComponent(url)}`, - '_blank', - 'noopener,noreferrer,width=600,height=420' - ) - incrementEngagement(question.id, 'shares') - } - - const shareToFacebook = async (question: DecoratedQuestion) => { - const url = getSocialUrl(question.id) - const answerSnippet = question.answer.replace(/\s+/g, ' ').trim() - const caption = [ - `Question: ${question.question}`, - `Answer: ${answerSnippet.length > 240 ? `${answerSnippet.slice(0, 237)}...` : answerSnippet}`, - 'What are your thoughts?' - ].join('\n\n') - - try { - await navigator.clipboard.writeText(caption) - setCopiedFacebookCaptionId(question.id) - window.setTimeout(() => { - setCopiedFacebookCaptionId(curr => (curr === question.id ? null : curr)) - }, 2500) - } catch { - window.prompt('Copy this caption and paste it into your post:', caption) - } - - window.open( - `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(url)}`, - '_blank', - 'noopener,noreferrer,width=600,height=500' - ) - incrementEngagement(question.id, 'shares') - } const formatDate = (value?: string) => { if (!value) return null @@ -999,7 +959,6 @@ export default function QASection() { const relatedQuestions = getRelatedQuestions(question) const isFocused = focusedQuestionId === question.id const isExpandedInCompact = expandedCompactAnswers[question.id] === true - const facebookCaptionCopied = copiedFacebookCaptionId === question.id const linkCopied = copiedQuestionId === question.id const answerText = compactMode && !isExpandedInCompact ? truncateAnswer(question.answer) @@ -1065,11 +1024,9 @@ export default function QASection() { Save image - {(facebookCaptionCopied || linkCopied) && ( + {linkCopied && (

- {facebookCaptionCopied - ? 'Caption copied. Paste it into your Facebook post text box.' - : 'Direct link copied to clipboard.'} + Direct link copied to clipboard.

)}