From 01b07f01e9340935faf51e5a3c8034cc90423989 Mon Sep 17 00:00:00 2001 From: eugenijm Date: Sat, 25 Apr 2020 07:04:39 +0300 Subject: Add support for follow request notifications --- src/components/notifications/notifications.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/components/notifications') diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index a8f4430f..80dad28b 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -82,6 +82,16 @@ .follow-text, .move-text { padding: 0.5em 0; overflow-wrap: break-word; + display: flex; + justify-content: space-between; + + .follow-name { + display: block; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } .status-el { @@ -143,6 +153,11 @@ color: var(--cGreen, $fallback--cGreen); } + .icon-user.lit { + color: $fallback--cBlue; + color: var(--cBlue, $fallback--cBlue); + } + .icon-user-plus.lit { color: $fallback--cBlue; color: var(--cBlue, $fallback--cBlue); -- cgit v1.2.3-70-g09d2 From 406fdd8edec210d14589e0ff684a166250236779 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Sat, 2 May 2020 10:19:47 +0300 Subject: follow request bugfixes, wrong text, notifs not being marked as read, approving from follow request view --- .../follow_request_card/follow_request_card.js | 19 +++++++++++++++++++ src/components/notification/notification.js | 1 + src/components/notification/notification.vue | 6 +++--- src/components/notifications/notifications.scss | 19 +++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) (limited to 'src/components/notifications') diff --git a/src/components/follow_request_card/follow_request_card.js b/src/components/follow_request_card/follow_request_card.js index a8931787..2a9d3db5 100644 --- a/src/components/follow_request_card/follow_request_card.js +++ b/src/components/follow_request_card/follow_request_card.js @@ -1,4 +1,5 @@ import BasicUserCard from '../basic_user_card/basic_user_card.vue' +import { notificationsFromStore } from '../../services/notification_utils/notification_utils.js' const FollowRequestCard = { props: ['user'], @@ -6,13 +7,31 @@ const FollowRequestCard = { BasicUserCard }, methods: { + findFollowRequestNotificationId () { + const notif = notificationsFromStore(this.$store).find( + (notif) => notif.from_profile.id === this.user.id && notif.type === 'follow_request' + ) + return notif && notif.id + }, approveUser () { this.$store.state.api.backendInteractor.approveUser({ id: this.user.id }) this.$store.dispatch('removeFollowRequest', this.user) + + const notifId = this.findFollowRequestNotificationId() + this.$store.dispatch('updateNotification', { + id: notifId, + updater: notification => { + notification.type = 'follow' + notification.seen = true + } + }) }, denyUser () { this.$store.state.api.backendInteractor.denyUser({ id: this.user.id }) this.$store.dispatch('removeFollowRequest', this.user) + + const notifId = this.findFollowRequestNotificationId() + this.$store.dispatch('dismissNotification', { id: notifId }) } } } diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 6deee7d5..8c20ff09 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -41,6 +41,7 @@ const Notification = { id: this.notification.id, updater: notification => { notification.type = 'follow' + notification.seen = true } }) }, diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 02802776..f6da07dd 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -137,13 +137,13 @@ style="white-space: nowrap;" > diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 80dad28b..9efcfcf8 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -79,6 +79,25 @@ } } + .follow-request-accept { + cursor: pointer; + + &:hover { + color: $fallback--text; + color: var(--text, $fallback--text); + } + } + + .follow-request-reject { + cursor: pointer; + + &:hover { + color: $fallback--cRed; + color: var(--cRed, $fallback--cRed); + } + } + + .follow-text, .move-text { padding: 0.5em 0; overflow-wrap: break-word; -- cgit v1.2.3-70-g09d2 From ebf2ce84fdd7e175f5715452400ec3bdf789310b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 6 Jun 2020 23:08:52 +0300 Subject: alignment fixes --- src/components/notifications/notifications.scss | 6 +-- src/components/status/status.vue | 62 +++++++++++++++++++------ src/i18n/en.json | 4 +- 3 files changed, 52 insertions(+), 20 deletions(-) (limited to 'src/components/notifications') diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 9efcfcf8..b675af5a 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -36,6 +36,8 @@ border-bottom: 1px solid; border-color: $fallback--border; border-color: var(--border, $fallback--border); + word-wrap: break-word; + word-break: break-word; &:hover .animated.avatar { canvas { @@ -46,10 +48,6 @@ } } - .muted { - padding: .25em .6em; - } - .non-mention { display: flex; flex: 1; diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 3137cb9d..336f912a 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -17,7 +17,7 @@