From fa8c221f3a6f9b1421e29aa014304576810a08e6 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 18 Jun 2018 12:09:14 +0300 Subject: [PATCH] moved style generator into separate file. notifications are highlighted too now. --- src/components/notification/notification.js | 9 ++++++ src/components/notification/notification.vue | 2 +- src/components/status/status.js | 31 +++---------------- .../user_highlighter/user_highlighter.js | 29 +++++++++++++++++ 4 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 src/services/user_highlighter/user_highlighter.js diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 3a274374..d2dd91de 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -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) + }, } } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index eed598a8..97673752 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,6 +1,6 @@