From 55f650f9642cc2767822e4759310ee2a45252285 Mon Sep 17 00:00:00 2001 From: James Morris Date: Wed, 20 Jul 2022 17:26:29 +0100 Subject: [PATCH] Updated some of the logic for the dropdowns for hidden, etc refs https://github.com/TryGhost/Team/issues/1693 --- apps/comments-ui/src/components/Comment.js | 4 ++-- .../components/modals/CommentContextMenu.js | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/comments-ui/src/components/Comment.js b/apps/comments-ui/src/components/Comment.js index 4c1e50a86f..2c53496783 100644 --- a/apps/comments-ui/src/components/Comment.js +++ b/apps/comments-ui/src/components/Comment.js @@ -58,8 +58,8 @@ const Comment = (props) => {

- - {canReply && (isNotPublished || !props.parent) && } + {!isNotPublished && } + {!isNotPublished && (canReply && (isNotPublished || !props.parent) && )}
{formatRelativeTime(comment.created_at)}
diff --git a/apps/comments-ui/src/components/modals/CommentContextMenu.js b/apps/comments-ui/src/components/modals/CommentContextMenu.js index 9a2c86d0ce..044fdf097a 100644 --- a/apps/comments-ui/src/components/modals/CommentContextMenu.js +++ b/apps/comments-ui/src/components/modals/CommentContextMenu.js @@ -10,9 +10,28 @@ const CommentContextMenu = (props) => { const isAuthor = member && comment.member?.uuid === member?.uuid; const isAdmin = !!admin; + let contextMenu = null; + if (comment.status === 'published') { + if (isAuthor) { + contextMenu = ; + } else { + if (isAdmin) { + contextMenu = ; + } else { + contextMenu = ; + } + } + } else { + if (isAdmin) { + contextMenu = ; + } else { + return null; + } + } + return (
- {isAuthor && comment.status === 'published' ? : (isAdmin ? : )} + {contextMenu}
); };