Comment: add option to hide the actions section
This commit is contained in:
parent
eb241b3504
commit
3a511842c1
1 changed files with 16 additions and 12 deletions
|
@ -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,18 +350,20 @@ function Comment(props: Props) {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="comment__actions">
|
{!hideActions && (
|
||||||
{threadDepth !== 0 && (
|
<div className="comment__actions">
|
||||||
<Button
|
{threadDepth !== 0 && (
|
||||||
requiresAuth={IS_WEB}
|
<Button
|
||||||
label={commentingEnabled ? __('Reply') : __('Log in to reply')}
|
requiresAuth={IS_WEB}
|
||||||
className="comment__action"
|
label={commentingEnabled ? __('Reply') : __('Log in to reply')}
|
||||||
onClick={handleCommentReply}
|
className="comment__action"
|
||||||
icon={ICONS.REPLY}
|
onClick={handleCommentReply}
|
||||||
/>
|
icon={ICONS.REPLY}
|
||||||
)}
|
/>
|
||||||
{ENABLE_COMMENT_REACTIONS && <CommentReactions uri={uri} commentId={commentId} />}
|
)}
|
||||||
</div>
|
{ENABLE_COMMENT_REACTIONS && <CommentReactions uri={uri} commentId={commentId} />}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{numDirectReplies > 0 && !showReplies && (
|
{numDirectReplies > 0 && !showReplies && (
|
||||||
<div className="comment__actions">
|
<div className="comment__actions">
|
||||||
|
|
Loading…
Reference in a new issue