From bfd530aaea75ab228d3ccc531de790cef2ddf332 Mon Sep 17 00:00:00 2001 From: wakarimasen Date: Thu, 9 Mar 2017 18:20:16 +0100 Subject: [PATCH 1/5] Let timeline component fetch mentions --- src/components/mentions/mentions.js | 13 ------------- src/services/api/api.service.js | 1 + 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/components/mentions/mentions.js b/src/components/mentions/mentions.js index 46a1c63e..841d5aa4 100644 --- a/src/components/mentions/mentions.js +++ b/src/components/mentions/mentions.js @@ -2,25 +2,12 @@ import Timeline from '../timeline/timeline.vue' const Mentions = { computed: { - username () { - return this.$route.params.username - }, timeline () { return this.$store.state.statuses.timelines.mentions } }, components: { Timeline - }, - created () { - this.$store.state.api.backendInteractor.fetchMentions({username: this.username}) - .then((mentions) => { - this.$store.dispatch('addNewStatuses', { - statuses: mentions, - timeline: 'mentions', - showImmediately: true - }) - }) } } diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index f172f769..86ae7f70 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -100,6 +100,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false}) => const timelineUrls = { public: PUBLIC_TIMELINE_URL, friends: FRIENDS_TIMELINE_URL, + mentions: MENTIONS_URL, 'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL } From d669c37f13409bf3ab57ccdf100c5ef860861e36 Mon Sep 17 00:00:00 2001 From: wakarimasen Date: Thu, 9 Mar 2017 18:21:42 +0100 Subject: [PATCH 2/5] Remove unused fetchMentions() --- src/services/api/api.service.js | 7 ------- .../backend_interactor_service.js | 5 ----- 2 files changed, 12 deletions(-) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 86ae7f70..4dfc0a02 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -62,12 +62,6 @@ const fetchAllFollowing = ({username, credentials}) => { .then((data) => data.json()) } -const fetchMentions = ({username, sinceId = 0, credentials}) => { - let url = `${MENTIONS_URL}?since_id=${sinceId}&screen_name=${username}` - return fetch(url, { headers: authHeaders(credentials) }) - .then((data) => data.json()) -} - const fetchConversation = ({id, credentials}) => { let url = `${CONVERSATION_URL}/${id}.json?count=100` return fetch(url, { headers: authHeaders(credentials) }) @@ -193,7 +187,6 @@ const apiService = { fetchTimeline, fetchConversation, fetchStatus, - fetchMentions, fetchFriends, followUser, unfollowUser, diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js index d379e602..bc68d02c 100644 --- a/src/services/backend_interactor_service/backend_interactor_service.js +++ b/src/services/backend_interactor_service/backend_interactor_service.js @@ -10,10 +10,6 @@ const backendInteractorService = (credentials) => { return apiService.fetchConversation({id, credentials}) } - const fetchMentions = ({sinceId, username}) => { - return apiService.fetchMentions({sinceId, username, credentials}) - } - const fetchFriends = () => { return apiService.fetchFriends({credentials}) } @@ -43,7 +39,6 @@ const backendInteractorService = (credentials) => { const backendInteractorServiceInstance = { fetchStatus, fetchConversation, - fetchMentions, fetchFriends, followUser, unfollowUser, From bd7a05dee11fd4482a9f72829b758f009e4bd67e Mon Sep 17 00:00:00 2001 From: shpuld Date: Thu, 9 Mar 2017 19:57:20 +0200 Subject: [PATCH 3/5] Fix red border not appearing on the last notification. --- src/components/notifications/notifications.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 37ae67ef..5cce7a73 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -73,7 +73,8 @@ } &:last-child { - border: none + border-bottom: none; + border-radius: 0 0 10px 10px; } } From df4dad18044bd7948ae31c2d7167bd8caec83bfb Mon Sep 17 00:00:00 2001 From: shpuld Date: Thu, 9 Mar 2017 21:32:54 +0200 Subject: [PATCH 4/5] Separate reply form from inside status to make it resistant to hilighting, make the reply button light up when reply window is open. --- src/components/status/status.vue | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 9b0827a7..eceb0a75 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -73,18 +73,21 @@ - - +
+
+ +
@@ -141,6 +144,10 @@ color: $blue; } + .icon-reply-active { + color: $blue; + } + .status .avatar { width: 48px; } @@ -172,4 +179,14 @@ margin-bottom: 1em; margin-top: 0.2em; } + + .reply-left { + flex: 0; + min-width: 48px; + } + + .reply-body { + flex: 1; + } + From 3bb5f86d0d804881bbe9b7b1e16d8eb551e5f2b3 Mon Sep 17 00:00:00 2001 From: shpuld Date: Fri, 10 Mar 2017 00:49:22 +0200 Subject: [PATCH 5/5] Use conditional class for reply icon color. --- src/components/status/status.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index eceb0a75..c180262e 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -73,8 +73,7 @@