mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Notifications board
This commit is contained in:
48
src/renderer/components/TheNotificationsBoard.vue
Normal file
48
src/renderer/components/TheNotificationsBoard.vue
Normal file
@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div id="notifications-board">
|
||||
<transition-group name="slide-fade">
|
||||
<BaseNotification
|
||||
v-for="notification in latestNotifications"
|
||||
:key="notification.uid"
|
||||
:message="notification.message"
|
||||
:title="notification.message"
|
||||
:status="notification.status"
|
||||
@close="removeNotification(notification.uid)"
|
||||
/>
|
||||
</transition-group>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import BaseNotification from '@/components/BaseNotification';
|
||||
|
||||
export default {
|
||||
name: 'TheNotificationsBoard',
|
||||
components: {
|
||||
BaseNotification
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
notifications: 'notifications/getNotifications'
|
||||
}),
|
||||
latestNotifications () {
|
||||
return this.notifications.slice(0, 10);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
removeNotification: 'notifications/removeNotification'
|
||||
})
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
#notifications-board{
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
right: 1rem;
|
||||
bottom: $footer-height+1rem;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user