From da4c65aebabd7fd104a77a1bd362cd8a4ba9be8c Mon Sep 17 00:00:00 2001 From: keyan Date: Wed, 27 Oct 2021 13:26:34 -0500 Subject: [PATCH] OP indicator --- components/comment.js | 4 +++- fragments/comments.js | 4 ++++ fragments/items.js | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/comment.js b/components/comment.js index f5d878c0..3d5104af 100644 --- a/components/comment.js +++ b/components/comment.js @@ -60,6 +60,8 @@ export default function Comment ({ } }, [item]) + const op = item.root.user.name === item.user.name + return (
\ - e.stopPropagation()}>@{item.user.name} + e.stopPropagation()}>@{item.user.name}{op && ' OP'} {timeSince(new Date(item.createdAt))} diff --git a/fragments/comments.js b/fragments/comments.js index f263c317..a63f3f61 100644 --- a/fragments/comments.js +++ b/fragments/comments.js @@ -20,6 +20,10 @@ export const COMMENT_FIELDS = gql` root { id title + user { + name + id + } } } ` diff --git a/fragments/items.js b/fragments/items.js index b32edf41..3e74f34d 100644 --- a/fragments/items.js +++ b/fragments/items.js @@ -22,6 +22,10 @@ export const ITEM_FIELDS = gql` root { id title + user { + name + id + } } }`