Add option to display user avatar in mention link

This commit is contained in:
Tusooa Zhu 2022-01-10 02:05:41 -05:00
commit 9fde13c968
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
6 changed files with 28 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
import { mapGetters, mapState } from 'vuex'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
import UserAvatar from '../user_avatar/user_avatar.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faAt
@ -12,6 +13,9 @@ library.add(
const MentionLink = {
name: 'MentionLink',
components: {
UserAvatar
},
props: {
url: {
required: true,
@ -108,6 +112,9 @@ const MentionLink = {
shouldShowTooltip () {
return this.mergedConfig.mentionLinkShowTooltip && this.mergedConfig.mentionLinkDisplay === 'short' && this.isRemote
},
shouldShowAvatar () {
return this.mergedConfig.mentionLinkShowAvatar
},
...mapGetters(['mergedConfig']),
...mapState({
currentUser: state => state.users.currentUser