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