Make comment hint opt-in

This commit is contained in:
Lim Chee Aun 2023-11-14 22:45:13 +08:00
parent d6afb473ee
commit 19ed85f298
2 changed files with 22 additions and 2 deletions

View file

@ -102,6 +102,7 @@ function Status({
onMediaClick, onMediaClick,
quoted, quoted,
onStatusLinkClick = () => {}, onStatusLinkClick = () => {},
enableCommentHint,
}) { }) {
if (skeleton) { if (skeleton) {
return ( return (
@ -293,6 +294,7 @@ function Status({
size={size} size={size}
contentTextWeight={contentTextWeight} contentTextWeight={contentTextWeight}
readOnly={readOnly} readOnly={readOnly}
enableCommentHint
/> />
</div> </div>
); );
@ -994,17 +996,30 @@ function Status({
(!!inReplyToId && inReplyToAccountId === status.account?.id) || (!!inReplyToId && inReplyToAccountId === status.account?.id) ||
!!snapStates.statusThreadNumber[sKey] !!snapStates.statusThreadNumber[sKey]
); );
}, [inReplyToId, inReplyToAccountId, status.account?.id, snapStates.statusThreadNumber[sKey]]); }, [
inReplyToId,
inReplyToAccountId,
status.account?.id,
snapStates.statusThreadNumber[sKey],
]);
const showCommentHint = useMemo(() => { const showCommentHint = useMemo(() => {
return ( return (
enableCommentHint &&
!isThread && !isThread &&
!withinContext && !withinContext &&
!inReplyToId && !inReplyToId &&
visibility === 'public' && visibility === 'public' &&
repliesCount > 0 repliesCount > 0
); );
}, [isThread, withinContext, inReplyToId, repliesCount, visibility]); }, [
enableCommentHint,
isThread,
withinContext,
inReplyToId,
repliesCount,
visibility,
]);
return ( return (
<article <article
@ -2463,6 +2478,7 @@ const QuoteStatuses = memo(({ id, instance, level = 0 }) => {
instance={q.instance} instance={q.instance}
size="s" size="s"
quoted={level + 1} quoted={level + 1}
enableCommentHint
/> />
</Link> </Link>
); );

View file

@ -531,6 +531,7 @@ function TimelineItem({
instance={instance} instance={instance}
size="s" size="s"
contentTextWeight contentTextWeight
enableCommentHint
// allowFilters={allowFilters} // allowFilters={allowFilters}
/> />
) : ( ) : (
@ -539,6 +540,7 @@ function TimelineItem({
instance={instance} instance={instance}
size="s" size="s"
contentTextWeight contentTextWeight
enableCommentHint
// allowFilters={allowFilters} // allowFilters={allowFilters}
/> />
)} )}
@ -625,12 +627,14 @@ function TimelineItem({
<Status <Status
statusID={statusID} statusID={statusID}
instance={instance} instance={instance}
enableCommentHint
// allowFilters={allowFilters} // allowFilters={allowFilters}
/> />
) : ( ) : (
<Status <Status
status={status} status={status}
instance={instance} instance={instance}
enableCommentHint
// allowFilters={allowFilters} // allowFilters={allowFilters}
/> />
)} )}