From e8c85434b7b884a9fa398d75694691548bc35aa3 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 27 Nov 2016 19:44:56 +0100 Subject: Add basic notification support. --- src/components/notifications/notifications.js | 16 +++++++++++++ src/components/notifications/notifications.scss | 32 +++++++++++++++++++++++++ src/components/notifications/notifications.vue | 31 ++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 src/components/notifications/notifications.js create mode 100644 src/components/notifications/notifications.scss create mode 100644 src/components/notifications/notifications.vue (limited to 'src/components/notifications') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js new file mode 100644 index 00000000..10f987a8 --- /dev/null +++ b/src/components/notifications/notifications.js @@ -0,0 +1,16 @@ +import { sortBy, take } from 'lodash' + +const Notifications = { + data () { + return { + visibleNotificationCount: 20 + } + }, + computed: { + visibleNotifications () { + return take(sortBy(this.$store.state.statuses.notifications, ({action}) => -action.id), this.visibleNotificationCount) + } + } +} + +export default Notifications diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss new file mode 100644 index 00000000..1257e751 --- /dev/null +++ b/src/components/notifications/notifications.scss @@ -0,0 +1,32 @@ +.notification { + padding: 0.5em; + padding-left: 1em; + display: flex; + border-bottom: 1px solid silver; + + .text { + h1 { + margin: 0; + padding: 0; + font-size: 1em; + } + + padding-left: 0.5em; + p { + margin: 0; + margin-top: 0; + margin-bottom: 0.5em; + } + } + + .avatar { + padding-top: 3px; + width: 32px; + height: 32px; + border-radius: 50%; + } + + &:last-child { + border: none + } +} diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue new file mode 100644 index 00000000..de5d9f00 --- /dev/null +++ b/src/components/notifications/notifications.vue @@ -0,0 +1,31 @@ + + + + -- cgit v1.2.3-70-g09d2