summaryrefslogtreecommitdiff
path: root/src/client/components/deck/notifications-column.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/components/deck/notifications-column.vue')
-rw-r--r--src/client/components/deck/notifications-column.vue69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/client/components/deck/notifications-column.vue b/src/client/components/deck/notifications-column.vue
new file mode 100644
index 0000000000..58873aa130
--- /dev/null
+++ b/src/client/components/deck/notifications-column.vue
@@ -0,0 +1,69 @@
+<template>
+<x-column :column="column" :is-stacked="isStacked" :menu="menu">
+ <template #header><fa :icon="faBell" style="margin-right: 8px;"/>{{ column.name }}</template>
+
+ <x-notifications/>
+</x-column>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+import { faCog } from '@fortawesome/free-solid-svg-icons';
+import { faBell } from '@fortawesome/free-regular-svg-icons';
+import XColumn from './column.vue';
+import XNotifications from '../notifications.vue';
+
+export default Vue.extend({
+ components: {
+ XColumn,
+ XNotifications
+ },
+
+ props: {
+ column: {
+ type: Object,
+ required: true
+ },
+ isStacked: {
+ type: Boolean,
+ required: true
+ }
+ },
+
+ data() {
+ return {
+ menu: null,
+ faBell
+ }
+ },
+
+ created() {
+ if (this.column.notificationType == null) {
+ this.column.notificationType = 'all';
+ this.$store.commit('deviceUser/updateDeckColumn', this.column);
+ }
+
+ this.menu = [{
+ icon: faCog,
+ text: this.$t('@.notification-type'),
+ action: () => {
+ this.$root.dialog({
+ title: this.$t('@.notification-type'),
+ type: null,
+ select: {
+ items: ['all', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest'].map(x => ({
+ value: x, text: this.$t('@.notification-types.' + x)
+ }))
+ default: this.column.notificationType,
+ },
+ showCancelButton: true
+ }).then(({ canceled, result: type }) => {
+ if (canceled) return;
+ this.column.notificationType = type;
+ this.$store.commit('deviceUser/updateDeckColumn', this.column);
+ });
+ }
+ }];
+ },
+});
+</script>