Skip to content

Commit 69f8438

Browse files
committed
fix(comments): Use proper icon components instead of icon classes to fix dark mode
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 0b4c337 commit 69f8438

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

apps/comments/src/components/Comment.vue

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,27 @@
4040
show if we have a message id and current user is author -->
4141
<NcActions v-if="isOwnComment && id && !loading" class="comment__actions">
4242
<template v-if="!editing">
43-
<NcActionButton :close-after-click="true"
44-
icon="icon-rename"
43+
<NcActionButton close-after-click
4544
@click="onEdit">
45+
<template #icon>
46+
<IconEdit :size="20" />
47+
</template>
4648
{{ t('comments', 'Edit comment') }}
4749
</NcActionButton>
4850
<NcActionSeparator />
49-
<NcActionButton :close-after-click="true"
50-
icon="icon-delete"
51+
<NcActionButton close-after-click
5152
@click="onDeleteWithUndo">
53+
<template #icon>
54+
<IconDelete :size="20" />
55+
</template>
5256
{{ t('comments', 'Delete comment') }}
5357
</NcActionButton>
5458
</template>
5559

56-
<NcActionButton v-else
57-
icon="icon-close"
58-
@click="onEditCancel">
60+
<NcActionButton v-else @click="onEditCancel">
61+
<template #icon>
62+
<IconClose :size="20" />
63+
</template>
5964
{{ t('comments', 'Cancel edit') }}
6065
</NcActionButton>
6166
</NcActions>
@@ -87,8 +92,8 @@
8792
:disabled="isEmptyMessage"
8893
@click="onSubmit">
8994
<template #icon>
90-
<span v-if="loading" class="icon-loading-small" />
91-
<ArrowRight v-else :size="20" />
95+
<NcLoadingIcon v-if="loading" />
96+
<IconArrowRight v-else :size="20" />
9297
</template>
9398
</NcButton>
9499
</div>
@@ -122,7 +127,11 @@ import NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator.
122127
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
123128
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
124129
import RichEditorMixin from '@nextcloud/vue/dist/Mixins/richEditor.js'
125-
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
130+
131+
import IconArrowRight from 'vue-material-design-icons/ArrowRight.vue'
132+
import IconClose from 'vue-material-design-icons/Close.vue'
133+
import IconDelete from 'vue-material-design-icons/Delete.vue'
134+
import IconEdit from 'vue-material-design-icons/Pencil.vue'
126135
127136
import Moment from './Moment.vue'
128137
import CommentMixin from '../mixins/CommentMixin.js'
@@ -134,15 +143,19 @@ export default {
134143
name: 'Comment',
135144
136145
components: {
146+
IconArrowRight,
147+
IconClose,
148+
IconDelete,
149+
IconEdit,
150+
Moment,
137151
NcActionButton,
138152
NcActions,
139153
NcActionSeparator,
140-
ArrowRight,
141154
NcAvatar,
142155
NcButton,
143-
Moment,
144156
NcRichContenteditable,
145157
},
158+
146159
mixins: [RichEditorMixin, CommentMixin],
147160
148161
inheritAttrs: false,

apps/comments/src/views/ActivityCommentEntry.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
</template>
3535

3636
<script lang="ts">
37+
import type { PropType } from 'vue'
3738
import { translate as t } from '@nextcloud/l10n'
3839
3940
import Comment from '../components/Comment.vue'
@@ -53,7 +54,7 @@ export default {
5354
required: true,
5455
},
5556
reloadCallback: {
56-
type: Function,
57+
type: Function as PropType<() => void>,
5758
required: true,
5859
},
5960
},

0 commit comments

Comments
 (0)