Comment: add option to hide the actions section

This commit is contained in:
infinite-persistence 2021-09-27 16:25:51 +08:00
parent eb241b3504
commit 3a511842c1
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -52,6 +52,7 @@ type Props = {
doToast: ({ message: string }) => void, doToast: ({ message: string }) => void,
isTopLevel?: boolean, isTopLevel?: boolean,
threadDepth: number, threadDepth: number,
hideActions?: boolean,
isPinned: boolean, isPinned: boolean,
othersReacts: ?{ othersReacts: ?{
like: number, like: number,
@ -95,6 +96,7 @@ function Comment(props: Props) {
doToast, doToast,
isTopLevel, isTopLevel,
threadDepth, threadDepth,
hideActions,
isPinned, isPinned,
othersReacts, othersReacts,
playingUri, playingUri,
@ -348,6 +350,7 @@ function Comment(props: Props) {
)} )}
</div> </div>
{!hideActions && (
<div className="comment__actions"> <div className="comment__actions">
{threadDepth !== 0 && ( {threadDepth !== 0 && (
<Button <Button
@ -360,6 +363,7 @@ function Comment(props: Props) {
)} )}
{ENABLE_COMMENT_REACTIONS && <CommentReactions uri={uri} commentId={commentId} />} {ENABLE_COMMENT_REACTIONS && <CommentReactions uri={uri} commentId={commentId} />}
</div> </div>
)}
{numDirectReplies > 0 && !showReplies && ( {numDirectReplies > 0 && !showReplies && (
<div className="comment__actions"> <div className="comment__actions">