mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 18:55:44 +03:00
Make comment hint opt-in
This commit is contained in:
parent
d6afb473ee
commit
19ed85f298
2 changed files with 22 additions and 2 deletions
|
@ -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
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
@ -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 (
|
||||
<article
|
||||
|
@ -2463,6 +2478,7 @@ const QuoteStatuses = memo(({ id, instance, level = 0 }) => {
|
|||
instance={q.instance}
|
||||
size="s"
|
||||
quoted={level + 1}
|
||||
enableCommentHint
|
||||
/>
|
||||
</Link>
|
||||
);
|
||||
|
|
|
@ -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({
|
|||
<Status
|
||||
statusID={statusID}
|
||||
instance={instance}
|
||||
enableCommentHint
|
||||
// allowFilters={allowFilters}
|
||||
/>
|
||||
) : (
|
||||
<Status
|
||||
status={status}
|
||||
instance={instance}
|
||||
enableCommentHint
|
||||
// allowFilters={allowFilters}
|
||||
/>
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue