From 701112f043720c294241852f9aa0a0f1956cd71c Mon Sep 17 00:00:00 2001 From: eal Date: Thu, 10 Aug 2017 19:17:40 +0300 Subject: [PATCH] Add follow notifications. --- src/components/notifications/notifications.scss | 4 ++++ src/components/notifications/notifications.vue | 9 +++++++++ src/modules/statuses.js | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index f02ced8d..84dd36fa 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -49,6 +49,10 @@ color: $green; } + .icon-user-plus.lit { + color: $blue; + } + .icon-reply.lit { color: $blue; } diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 6c0419a5..c9113bc4 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -36,6 +36,15 @@ +
+

+ {{ notification.action.user.name }} + +

+
+ @{{ notification.action.user.screen_name }} followed you +
+
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 084800fa..de5d7d23 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -105,6 +105,10 @@ export const statusType = (status) => { return 'deletion' } + if (status.text.match(/started following/)) { + return 'follow' + } + return 'unknown' } @@ -253,6 +257,9 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us favoriteStatus(favorite) } }, + 'follow': (status) => { + addNotification({ type: 'follow', status: status, action: status }) + }, 'deletion': (deletion) => { const uri = deletion.uri updateMaxId(deletion)