Skip to content

Commit

Permalink
feat: add approved status in comment and reply list (#51)
Browse files Browse the repository at this point in the history
支持显示审核中的状态。

Fix #50 

<img width="574" alt="image" src="https://github.com/halo-sigs/plugin-comment-widget/assets/21301288/3b7c87b0-dae7-4c73-8ebb-154ad788f5f3">

```release-note
支持显示审核中的状态。
```
  • Loading branch information
ruibaby committed Jul 14, 2023
1 parent 51692b5 commit a695775
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
13 changes: 10 additions & 3 deletions packages/comment-widget/src/components/CommentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ const handleUpvote = async () => {
>
{{ timeAgo(comment?.spec.creationTime) }}
</span>
<span
v-if="!comment?.spec.approved"
class="text-xs text-gray-500 dark:text-slate-400"
>
审核中
</span>
<VTag
v-if="isAuthor"
rounded
Expand All @@ -166,9 +172,10 @@ const handleUpvote = async () => {
</div>
</div>
<div class="comment-content mt-2">
<pre class="text-sm text-gray-800 dark:text-slate-200">{{
comment?.spec.content
}}</pre>
<pre
class="whitespace-pre-wrap break-words text-sm text-gray-800 dark:text-slate-200"
>{{ comment?.spec.content }}</pre
>
</div>
<div class="comment-actions mt-2 flex flex-auto items-center gap-1.5">
<div
Expand Down
10 changes: 9 additions & 1 deletion packages/comment-widget/src/components/ReplyItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ const handleUpvote = async () => {
>
{{ timeAgo(reply.spec.creationTime) }}
</span>
<span
v-if="!reply?.spec.approved"
class="text-xs text-gray-500 dark:text-slate-400"
>
审核中
</span>
<VTag
v-if="false"
rounded
Expand All @@ -129,7 +135,9 @@ const handleUpvote = async () => {
</div>
</div>
<div class="reply-content mt-2">
<pre class="text-sm text-gray-800 dark:text-slate-200"><a
<pre
class="whitespace-pre-wrap break-words text-sm text-gray-800 dark:text-slate-200"
><a
v-if="quoteReply"
class="mr-1 inline-flex flex-row items-center gap-1 rounded bg-gray-200 py-0.5 px-1 text-xs font-medium text-gray-600 hover:text-blue-500 hover:underline dark:bg-slate-700 dark:text-slate-200 dark:hover:text-slate-100"
:href="`#reply-${quoteReply.metadata.name}`"
Expand Down
23 changes: 13 additions & 10 deletions src/main/resources/static/comment-widget.iife.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/resources/static/style.css

Large diffs are not rendered by default.

0 comments on commit a695775

Please sign in to comment.