1
0
mirror of https://git.pleroma.social/sjw/pleroma-fe.git synced 2024-11-12 07:29:03 +01:00
pleroma-fe/src/components/notification/notification.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

import Status from '../status/status.vue'
import UserAvatar from '../user_avatar/user_avatar.vue'
2019-03-05 20:01:49 +01:00
import UserCard from '../user_card/user_card.vue'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
const Notification = {
data () {
return {
userExpanded: false,
betterShadow: this.$store.state.interface.browserSupport.cssFilter
}
},
props: [ 'notification' ],
components: {
2019-03-05 20:01:49 +01:00
Status, UserAvatar, UserCard
},
methods: {
toggleUserExpanded () {
this.userExpanded = !this.userExpanded
2018-12-17 00:52:27 +01:00
},
userProfileLink (user) {
return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)
}
},
computed: {
userClass () {
return highlightClass(this.notification.action.user)
},
userStyle () {
const highlight = this.$store.state.config.highlight
const user = this.notification.action.user
return highlightStyle(highlight[user.screen_name])
}
}
}
export default Notification