moved style generator into separate file. notifications are highlighted too now.

This commit is contained in:
Henry Jameson 2018-06-18 12:09:14 +03:00
parent f911182a2f
commit fa8c221f3a
4 changed files with 44 additions and 27 deletions

View file

@ -1,6 +1,7 @@
import Status from '../status/status.vue'
import StillImage from '../still-image/still-image.vue'
import UserCardContent from '../user_card_content/user_card_content.vue'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
const Notification = {
data () {
@ -18,6 +19,14 @@ const Notification = {
toggleUserExpanded () {
this.userExpanded = !this.userExpanded
}
},
computed: {
userClass () {
return highlightClass(this.notification.action.user, this.$store)
},
userStyle () {
return highlightStyle(this.notification.action.user, this.$store)
},
}
}

View file

@ -1,6 +1,6 @@
<template>
<status v-if="notification.type === 'mention'" :compact="true" :statusoid="notification.status"></status>
<div class="non-mention" v-else>
<div class="non-mention" :class="[userClass, { highlighted: userStyle }]" :style="[ userStyle ]"v-else>
<a class='avatar-container' :href="notification.action.user.statusnet_profile_url" @click.stop.prevent.capture="toggleUserExpanded">
<StillImage class='avatar-compact' :src="notification.action.user.profile_image_url_original"/>
</a>