2020-02-18 23:16:49 +02:00
|
|
|
<template>
|
2021-10-09 06:33:08 +03:00
|
|
|
<div>
|
|
|
|
<MkHeader :info="header"/>
|
|
|
|
<div class="clupoqwt" v-size="{ min: [800] }">
|
2021-10-09 06:44:19 +03:00
|
|
|
<XNotifications class="notifications" @before="before" @after="after" :unread-only="tab === 'unread'"/>
|
2021-10-09 06:33:08 +03:00
|
|
|
</div>
|
2020-02-18 23:16:49 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-10-09 06:44:19 +03:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-03-23 10:30:14 +02:00
|
|
|
import Progress from '@client/scripts/loading';
|
|
|
|
import XNotifications from '@client/components/notifications.vue';
|
|
|
|
import * as os from '@client/os';
|
2021-04-10 06:54:12 +03:00
|
|
|
import * as symbols from '@client/symbols';
|
2020-02-18 23:16:49 +02:00
|
|
|
|
2020-10-17 14:12:00 +03:00
|
|
|
export default defineComponent({
|
2020-02-18 23:16:49 +02:00
|
|
|
components: {
|
|
|
|
XNotifications
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 06:54:12 +03:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 03:47:36 +02:00
|
|
|
title: this.$ts.notifications,
|
2021-04-20 17:22:59 +03:00
|
|
|
icon: 'fas fa-bell',
|
2021-09-17 16:39:15 +03:00
|
|
|
bg: 'var(--bg)',
|
2021-10-09 06:33:08 +03:00
|
|
|
},
|
2021-10-09 06:44:19 +03:00
|
|
|
tab: 'all',
|
|
|
|
header: computed(() => ({
|
2021-10-09 06:33:08 +03:00
|
|
|
title: this.$ts.notifications,
|
|
|
|
icon: 'fas fa-bell',
|
|
|
|
bg: 'var(--bg)',
|
2021-04-10 07:38:24 +03:00
|
|
|
actions: [{
|
|
|
|
text: this.$ts.markAllAsRead,
|
2021-04-20 17:22:59 +03:00
|
|
|
icon: 'fas fa-check',
|
2021-04-10 07:38:24 +03:00
|
|
|
handler: () => {
|
|
|
|
os.apiWithDialog('notifications/mark-all-as-read');
|
2021-10-09 06:44:19 +03:00
|
|
|
},
|
|
|
|
}],
|
|
|
|
tabs: [{
|
|
|
|
active: this.tab === 'all',
|
|
|
|
title: this.$ts.all,
|
|
|
|
onClick: () => { this.tab = 'all'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'unread',
|
|
|
|
title: this.$ts.unread,
|
|
|
|
onClick: () => { this.tab = 'unread'; },
|
|
|
|
},]
|
|
|
|
})),
|
2020-02-18 23:16:49 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
before() {
|
|
|
|
Progress.start();
|
|
|
|
},
|
|
|
|
|
|
|
|
after() {
|
|
|
|
Progress.done();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2021-08-21 11:40:15 +03:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.clupoqwt {
|
|
|
|
&.min-width_800px {
|
|
|
|
background: var(--bg);
|
|
|
|
padding: 32px 0;
|
|
|
|
|
|
|
|
> .notifications {
|
|
|
|
max-width: 800px;
|
|
|
|
margin: 0 auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|