summaryrefslogtreecommitdiff
path: root/src/client/app/mobile/views/pages/notifications.vue
blob: c6e5b646f2534460fca269df88f1956027070788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<template>
<mk-ui>
	<span slot="header"><span style="margin-right:4px;"><fa :icon="['far', 'bell']"/></span>{{ $t('notifications') }}</span>
	<template slot="func"><button @click="fn"><fa icon="check"/></button></template>

	<main>
		<mk-notifications @fetched="onFetched"/>
	</main>
</mk-ui>
</template>

<script lang="ts">
import Vue from 'vue';
import i18n from '../../../i18n';
import Progress from '../../../common/scripts/loading';

export default Vue.extend({
	i18n: i18n('mobile/views/pages/notifications.vue'),
	mounted() {
		document.title = this.$t('notifications');

		Progress.start();
	},
	methods: {
		fn() {
			this.$root.dialog({
				type: 'warning',
				text: this.$t('read-all'),
				showCancelButton: true
			}).then(({ canceled }) => {
				if (canceled) return;

				this.$root.api('notifications/mark_all_as_read');
			});
		},
		onFetched() {
			Progress.done();
		}
	}
});
</script>

<style lang="stylus" scoped>
main
	width 100%
	max-width 680px
	margin 0 auto
	padding 8px

	@media (min-width 500px)
		padding 16px

	@media (min-width 600px)
		padding 32px

</style>