2018-04-09 19:44:37 +02:00
|
|
|
import Status from '../status/status.vue'
|
2019-02-02 21:33:02 +01:00
|
|
|
import UserAvatar from '../user_avatar/user_avatar.vue'
|
2019-03-05 20:01:49 +01:00
|
|
|
import UserCard from '../user_card/user_card.vue'
|
2018-06-18 11:09:14 +02:00
|
|
|
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
2018-12-13 17:57:11 +01:00
|
|
|
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
2018-04-09 19:44:37 +02:00
|
|
|
|
|
|
|
const Notification = {
|
|
|
|
data () {
|
|
|
|
return {
|
2018-11-30 14:39:07 +01:00
|
|
|
userExpanded: false,
|
|
|
|
betterShadow: this.$store.state.interface.browserSupport.cssFilter
|
2018-04-09 19:44:37 +02:00
|
|
|
}
|
|
|
|
},
|
2018-12-28 20:39:54 +01:00
|
|
|
props: [ 'notification' ],
|
2018-04-09 19:44:37 +02:00
|
|
|
components: {
|
2019-03-05 20:01:49 +01:00
|
|
|
Status, UserAvatar, UserCard
|
2018-04-09 19:44:37 +02:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleUserExpanded () {
|
|
|
|
this.userExpanded = !this.userExpanded
|
2018-12-17 00:52:27 +01:00
|
|
|
},
|
|
|
|
userProfileLink (user) {
|
2018-12-26 14:50:48 +01:00
|
|
|
return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)
|
2018-04-09 19:44:37 +02:00
|
|
|
}
|
2018-06-18 11:09:14 +02:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
userClass () {
|
2018-06-19 15:17:50 +02:00
|
|
|
return highlightClass(this.notification.action.user)
|
2018-06-18 11:09:14 +02:00
|
|
|
},
|
|
|
|
userStyle () {
|
2018-06-19 15:17:50 +02:00
|
|
|
const highlight = this.$store.state.config.highlight
|
|
|
|
const user = this.notification.action.user
|
2018-08-05 04:18:04 +02:00
|
|
|
return highlightStyle(highlight[user.screen_name])
|
2018-06-19 15:17:50 +02:00
|
|
|
}
|
2018-04-09 19:44:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Notification
|