2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
2023-12-07 15:57:16 +01:00
|
|
|
<section v-if="notifications.length > 0" class="notifications">
|
2018-08-11 07:47:10 +02:00
|
|
|
<div class="columns is-centered">
|
|
|
|
<div class="column is-half">
|
2022-05-29 18:49:00 +02:00
|
|
|
<div
|
|
|
|
v-for="notification in notifications"
|
|
|
|
:key="notification.id"
|
2023-11-29 11:18:43 +01:00
|
|
|
class="notification"
|
2023-12-07 15:57:16 +01:00
|
|
|
:class="notification.type ? `is-${notification.type}` : ''"
|
2022-05-29 18:49:00 +02:00
|
|
|
>
|
2022-02-19 06:39:14 +01:00
|
|
|
<button class="delete" @click="remove(notification)" />
|
2023-12-07 15:57:16 +01:00
|
|
|
<div class="text" v-text="notification.text" />
|
2018-08-11 07:47:10 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2022-02-19 07:05:59 +01:00
|
|
|
name: 'NotificationList',
|
2018-08-11 07:47:10 +02:00
|
|
|
|
|
|
|
computed: {
|
2022-02-19 06:39:14 +01:00
|
|
|
notifications() {
|
2018-08-11 07:47:10 +02:00
|
|
|
return this.$store.state.notifications.list
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2023-06-07 21:25:54 +02:00
|
|
|
remove(notification) {
|
2024-02-21 14:02:47 +01:00
|
|
|
this.$store.dispatch('delete_notification', notification)
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2023-12-07 15:57:16 +01:00
|
|
|
<style scoped>
|
|
|
|
.notifications {
|
2018-08-11 07:47:10 +02:00
|
|
|
position: fixed;
|
2023-12-07 15:57:16 +01:00
|
|
|
bottom: 4rem;
|
2018-08-11 07:47:10 +02:00
|
|
|
z-index: 20000;
|
|
|
|
width: 100%;
|
|
|
|
}
|
2023-12-07 15:57:16 +01:00
|
|
|
.notifications .notification {
|
2023-11-21 17:09:06 +01:00
|
|
|
box-shadow:
|
|
|
|
0 4px 8px 0 rgba(0, 0, 0, 0.2),
|
|
|
|
0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
2023-12-07 15:57:16 +01:00
|
|
|
.notification .text {
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
max-height: 6rem;
|
|
|
|
overflow: scroll;
|
|
|
|
}
|
2018-08-11 07:47:10 +02:00
|
|
|
</style>
|