aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/notifications')
-rw-r--r--src/components/notifications/notifications.js12
-rw-r--r--src/components/notifications/notifications.scss50
-rw-r--r--src/components/notifications/notifications.vue6
3 files changed, 24 insertions, 44 deletions
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index b24250b0..58956f98 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -11,6 +11,14 @@ const Notifications = {
notificationsFetcher.startFetching({ store, credentials })
},
computed: {
+ visibleTypes () {
+ return [
+ this.$store.state.config.notificationVisibility.likes && 'like',
+ this.$store.state.config.notificationVisibility.mentions && 'mention',
+ this.$store.state.config.notificationVisibility.repeats && 'repeat',
+ this.$store.state.config.notificationVisibility.follows && 'follow'
+ ].filter(_ => _)
+ },
notifications () {
return this.$store.state.statuses.notifications.data
},
@@ -18,13 +26,13 @@ const Notifications = {
return this.$store.state.statuses.notifications.error
},
unseenNotifications () {
- return filter(this.notifications, ({seen}) => !seen)
+ return filter(this.visibleNotifications, ({seen}) => !seen)
},
visibleNotifications () {
// Don't know why, but sortBy([seen, -action.id]) doesn't work.
let sortedNotifications = sortBy(this.notifications, ({action}) => -action.id)
sortedNotifications = sortBy(sortedNotifications, 'seen')
- return sortedNotifications
+ return sortedNotifications.filter((notification) => this.visibleTypes.includes(notification.type))
},
unseenCount () {
return this.unseenNotifications.length
diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss
index 5b09685b..f14b7d40 100644
--- a/src/components/notifications/notifications.scss
+++ b/src/components/notifications/notifications.scss
@@ -4,58 +4,27 @@
// a bit of a hack to allow scrolling below notifications
padding-bottom: 15em;
- .title {
- display: inline-block;
- }
-
- .panel {
- background: $fallback--bg;
- background: var(--bg, $fallback--bg)
- }
-
- .panel-body {
- border-color: $fallback--border;
- border-color: var(--border, $fallback--border)
- }
-
- .panel-heading {
- // force the text to stay centered, while keeping
- // the button in the right side of the panel heading
- position: relative;
- background: $fallback--btn;
- background: var(--btn, $fallback--btn);
- color: $fallback--fg;
- color: var(--fg, $fallback--fg);
- display: flex;
- align-items: baseline;
- .read-button {
- position: absolute;
- right: 0.7em;
- height: 1.8em;
- line-height: 100%;
- }
- }
-
.unseen-count {
display: inline-block;
background-color: $fallback--cRed;
background-color: var(--cRed, $fallback--cRed);
text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5);
- min-width: 1.3em;
- border-radius: 1.3em;
- margin: 0 0.2em 0 -0.4em;
+ border-radius: 99px;
+ min-width: 22px;
+ max-width: 22px;
+ min-height: 22px;
+ max-height: 22px;
color: white;
- font-size: 0.9em;
+ font-size: 15px;
+ line-height: 22px;
text-align: center;
- line-height: 1.3em;
+ vertical-align: middle
}
.loadmore-error {
position: absolute;
right: 0.6em;
- font-size: 14px;
min-width: 6em;
- font-family: sans-serif;
text-align: center;
padding: 0 0.25em 0 0.25em;
margin: 0;
@@ -73,7 +42,8 @@
box-sizing: border-box;
display: flex;
border-bottom: 1px solid;
- border-bottom-color: inherit;
+ border-color: $fallback--border;
+ border-color: var(--border, $fallback--border);
.broken-favorite {
border-radius: $fallback--tooltipRadius;
diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index a0b0e5f5..7a4322f9 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -2,8 +2,10 @@
<div class="notifications">
<div class="panel panel-default">
<div class="panel-heading">
- <span class="unseen-count" v-if="unseenCount">{{unseenCount}}</span>
- <div class="title"> {{$t('notifications.notifications')}}</div>
+ <div class="title">
+ {{$t('notifications.notifications')}}
+ <span class="unseen-count" v-if="unseenCount">{{unseenCount}}</span>
+ </div>
<div @click.prevent class="loadmore-error alert error" v-if="error">
{{$t('timeline.error_fetching')}}
</div>