2020-07-11 10:13:11 +09:00
|
|
|
<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,
|
2020-07-26 13:30:36 +09:00
|
|
|
text: this.$t('notificationType'),
|
2020-07-11 10:13:11 +09:00
|
|
|
action: () => {
|
|
|
|
this.$root.dialog({
|
2020-07-26 13:30:36 +09:00
|
|
|
title: this.$t('notificationType'),
|
2020-07-11 10:13:11 +09:00
|
|
|
type: null,
|
|
|
|
select: {
|
|
|
|
items: ['all', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest'].map(x => ({
|
2020-07-26 13:30:36 +09:00
|
|
|
value: x, text: this.$t(`_notification._types.${x}`)
|
2020-07-11 10:13:11 +09:00
|
|
|
}))
|
|
|
|
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>
|