From f4f9b3fa265df95ade97625cf2f870ded0825eb1 Mon Sep 17 00:00:00 2001 From: shpuld Date: Mon, 9 Apr 2018 19:43:31 +0300 Subject: small fixes --- src/components/notifications/notifications.js | 14 ++-- src/components/notifications/notifications.scss | 97 +++++++++++++++++-------- src/components/notifications/notifications.vue | 62 ++++++---------- 3 files changed, 97 insertions(+), 76 deletions(-) (limited to 'src/components/notifications') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index e9b83bf0..19f767ab 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -1,12 +1,14 @@ 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 { sortBy, take, filter } from 'lodash' const Notifications = { data () { return { - visibleNotificationCount: 10 + visibleNotificationCount: 10, + userExpanded: false } }, computed: { @@ -24,15 +26,10 @@ const Notifications = { }, unseenCount () { return this.unseenNotifications.length - }, - hiderStyle () { - return { - background: `linear-gradient(to bottom, rgba(0, 0, 0, 0), ${this.$store.state.config.colors['base00']} 80%)` - } } }, components: { - Status, StillImage + Status, StillImage, UserCardContent }, watch: { unseenCount (count) { @@ -46,6 +43,9 @@ const Notifications = { methods: { markAsSeen () { this.$store.commit('markNotificationsAsSeen', this.visibleNotifications) + }, + toggleUserExpanded () { + this.userExpanded = !this.userExpanded } } } diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 3c500b36..73a70a14 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -30,22 +30,52 @@ } .notification { - // Will have to use pixels here to ensure consistent distance with - // pad alone and pad + border, browsers bad at rounding this with em, - // they love to give a 1 pixel ghost offset with 0.7em vs 0.3em + 0.4em, - // which does not happen with 10px vs 4px + 6px. - padding: 0.4em 0 0 10px; + padding-left: 4px; + box-sizing: border-box; display: flex; border-bottom: 1px solid; border-bottom-color: inherit; + .non-mention { + display: flex; + flex: 1; + flex-wrap: nowrap; + padding: 0.6em; + .status-el { + padding: 0; + .status-content.media-body { + margin: 0; + } + } + } - .text { + .status-el { + flex: 1; + } + + .notification-right { + flex: 1; + margin-left: 0.8em; + } + + .notification-details { min-width: 0px; word-wrap: break-word; line-height:18px; position: relative; overflow: hidden; + width: 100%; + padding: 0.5em; + flex: 1; + flex-wrap: nowrap; + + .username { + font-weight: bolder; + } + .timeago { + float: right; + font-size: 12px; + } .icon-retweet.lit { color: $green; @@ -79,7 +109,6 @@ } } - padding: 0.3em 0.8em 0.5em; p { margin: 0; margin-top: 0; @@ -87,29 +116,6 @@ } } - .avatar { - margin-top: 0.3em; - width: 32px; - height: 32px; - border-radius: 50%; - overflow: hidden; - line-height: 0; - - &.animated::before { - display: none; - } - - } - - &:hover .animated.avatar { - canvas { - display: none; - } - img { - visibility: visible; - } - } - &:last-child { border-bottom: none; border-radius: 0 0 10px 10px; @@ -135,6 +141,35 @@ .unseen { border-left: 4px solid rgba(255, 16, 8, 0.75); - padding-left: 6px; + padding-left: 0px; + } +} + +.notification { + .avatar-compact { + margin-top: 0.3em; + width: 32px; + height: 32px; + border-radius: 50%; + overflow: hidden; + line-height: 0; + + &.animated::before { + display: none; + } + + } + + &:hover .animated.avatar { + canvas { + display: none; + } + img { + visibility: visible; + } + } + + .notification-usercard { + margin-left: 0.8em; } } diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 8e6f12b2..99f00032 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -8,46 +8,32 @@
-
- - + + -
-
-

- {{ notification.action.user.name }} - - -

-
-
-
-
-

- {{ notification.action.user.name }} - - -

-
-
-
-
-

- {{ notification.action.user.name }} - - -

- -
-
-

- {{ notification.action.user.name }} - -

-
- @{{ notification.action.user.screen_name }} {{$t('notifications.followed_you')}} +
+
+
+ + {{ notification.action.user.name }} + + + {{$t('notifications.favorited_you')}} + + + + {{$t('notifications.repeated_you')}} + + + + {{$t('notifications.followed_you')}} + + + +
-- cgit v1.2.3-70-g09d2