From 5c6a319b5584053b84475ff7e10faeaccee529fd Mon Sep 17 00:00:00 2001 From: Ido Shamun Date: Thu, 10 Sep 2020 14:50:05 +0300 Subject: [PATCH] feat: allow mods to delete comments --- components/CommentActionButtons.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/CommentActionButtons.tsx b/components/CommentActionButtons.tsx index 1abdb7d52da..f9b4e8b0ab4 100644 --- a/components/CommentActionButtons.tsx +++ b/components/CommentActionButtons.tsx @@ -15,6 +15,7 @@ import { UpvoteCommentData, } from '../graphql/comments'; import { useMutation } from '@apollo/client'; +import { Roles } from '../lib/user'; export interface Props { comment: Comment; @@ -96,7 +97,8 @@ export default function CommentActionButtons({ > - {user?.id === comment.author.id && ( + {(user?.id === comment.author.id || + user?.roles?.indexOf(Roles.Moderator) > -1) && (