From 19ed85f2987e28512be1b5755fc17675463a7187 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 14 Nov 2023 22:45:13 +0800 Subject: [PATCH] Make comment hint opt-in --- src/components/status.jsx | 20 ++++++++++++++++++-- src/components/timeline.jsx | 4 ++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/status.jsx b/src/components/status.jsx index 8030fb28..9e0f2dfb 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -102,6 +102,7 @@ function Status({ onMediaClick, quoted, onStatusLinkClick = () => {}, + enableCommentHint, }) { if (skeleton) { return ( @@ -293,6 +294,7 @@ function Status({ size={size} contentTextWeight={contentTextWeight} readOnly={readOnly} + enableCommentHint /> ); @@ -994,17 +996,30 @@ function Status({ (!!inReplyToId && inReplyToAccountId === status.account?.id) || !!snapStates.statusThreadNumber[sKey] ); - }, [inReplyToId, inReplyToAccountId, status.account?.id, snapStates.statusThreadNumber[sKey]]); + }, [ + inReplyToId, + inReplyToAccountId, + status.account?.id, + snapStates.statusThreadNumber[sKey], + ]); const showCommentHint = useMemo(() => { return ( + enableCommentHint && !isThread && !withinContext && !inReplyToId && visibility === 'public' && repliesCount > 0 ); - }, [isThread, withinContext, inReplyToId, repliesCount, visibility]); + }, [ + enableCommentHint, + isThread, + withinContext, + inReplyToId, + repliesCount, + visibility, + ]); return (
{ instance={q.instance} size="s" quoted={level + 1} + enableCommentHint /> ); diff --git a/src/components/timeline.jsx b/src/components/timeline.jsx index f5968a6b..9b8e7e10 100644 --- a/src/components/timeline.jsx +++ b/src/components/timeline.jsx @@ -531,6 +531,7 @@ function TimelineItem({ instance={instance} size="s" contentTextWeight + enableCommentHint // allowFilters={allowFilters} /> ) : ( @@ -539,6 +540,7 @@ function TimelineItem({ instance={instance} size="s" contentTextWeight + enableCommentHint // allowFilters={allowFilters} /> )} @@ -625,12 +627,14 @@ function TimelineItem({ ) : ( )}