diff --git a/frontend_nuxt/components/CommentItem.vue b/frontend_nuxt/components/CommentItem.vue index 39f044aa9..b47456dda 100644 --- a/frontend_nuxt/components/CommentItem.vue +++ b/frontend_nuxt/components/CommentItem.vue @@ -15,6 +15,7 @@
{{ comment.userName }} + OP authState.loggedIn) const countReplies = (list) => list.reduce((sum, r) => sum + 1 + countReplies(r.reply || []), 0) const replyCount = computed(() => countReplies(props.comment.reply || [])) +const isCommentFromPostAuthor = computed(() => { + if (props.comment.userId == null || props.postAuthorId == null) { + return false + } + return String(props.comment.userId) === String(props.postAuthorId) +}) const toggleReplies = () => { showReplies.value = !showReplies.value @@ -426,6 +433,21 @@ const handleContentClick = (e) => { color: var(--text-color); } +.op-badge { + display: inline-flex; + align-items: center; + justify-content: center; + margin-left: 6px; + padding: 0 6px; + height: 18px; + border-radius: 9px; + background-color: rgba(242, 100, 25, 0.12); + color: #f26419; + font-size: 12px; + font-weight: 600; + line-height: 1; +} + .medal-icon { font-size: 12px; opacity: 0.6;