File tree Expand file tree Collapse file tree 3 files changed +22
-16
lines changed Expand file tree Collapse file tree 3 files changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ defineProps<{
88 disabled? : boolean ;
99 full? : boolean ;
1010 toggled? : boolean ;
11+ highlight? : boolean ;
1112}>();
1213 </script >
1314
@@ -18,6 +19,7 @@ defineProps<{
1819 :type =" toggled ? 'primary' : undefined"
1920 :block =" full"
2021 :circle =" !full"
22+ :color =" highlight && !toggled ? 'var(--error-color)' : undefined"
2123 :focusable =" false"
2224 :title =" !full ? title : undefined"
2325 :disabled =" disabled"
Original file line number Diff line number Diff line change @@ -98,7 +98,12 @@ function handleSmallScreenWidgetsTriggered() {
9898 <!-- generic content widgets -->
9999 <location-content-context-widget :resource =" resource" full @done =" closeModal" />
100100 <correction-note-widget :resource =" resource" full @done =" closeModal" />
101- <content-comment-widget :resource =" resource" full @done =" closeModal" />
101+ <content-comment-widget
102+ v-model:show-comments =" showComments"
103+ :resource =" resource"
104+ full
105+ @done =" closeModal"
106+ />
102107 <content-edit-widget :resource =" resource" full @done =" closeModal" />
103108 <resource-settings-widget :resource =" resource" full @done =" closeModal" />
104109 <jump-to-content-widget :resource =" resource" direction =" before" full @done =" closeModal" />
Original file line number Diff line number Diff line change 22import type { AnyResourceRead } from ' @/api' ;
33import ContentContainerHeaderWidget from ' @/components/browse/ContentContainerHeaderWidget.vue' ;
44import { CommentIcon } from ' @/icons' ;
5- import { NBadge } from ' naive-ui' ;
65import { computed } from ' vue' ;
76
87const props = defineProps <{
@@ -25,18 +24,18 @@ const hasComments = computed(
2524 </script >
2625
2726<template >
28- <n-badge v-if = " hasComments " :show = " !showComments " dot :offset = " [-5, 10] " >
29- < content-container-header-widget
30- :full =" full"
31- :title =" $t('common.comment', 2)"
32- :icon-component =" CommentIcon"
33- :toggled =" showComments"
34- @click = "
35- () => {
36- showComments = !showComments;
37- emit('done') ;
38- }
39- "
40- />
41- </ n-badge >
27+ <content-container-header-widget
28+ v-if = " hasComments "
29+ :full =" full"
30+ :title =" $t('common.comment', 2)"
31+ :icon-component =" CommentIcon"
32+ :toggled =" showComments"
33+ :highlight = " hasComments && !showComments "
34+ @click = "
35+ () => {
36+ showComments = !showComments ;
37+ emit('done');
38+ }
39+ "
40+ / >
4241</template >
You can’t perform that action at this time.
0 commit comments