summaryrefslogtreecommitdiff
path: root/src/client/pages/settings/mute-block.vue
blob: 03cf4aacc82766cca0420a9cb195743790299a59 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
<section class="rrfwjxfl _card">
	<div class="_title"><fa :icon="faBan"/> {{ $t('muteAndBlock') }}</div>
	<div class="_content">
		<span>{{ $t('mutedUsers') }}</span>
		<mk-pagination :pagination="mutingPagination" class="muting">
			<template #empty><span>{{ $t('noUsers') }}</span></template>
			<template #default="{items}">
				<div class="user" v-for="(mute, i) in items" :key="mute.id">
					<router-link class="name" :to="mute.mutee | userPage">
						<mk-acct :user="mute.mutee"/>
					</router-link>
				</div>
			</template>
		</mk-pagination>
	</div>
	<div class="_content">
		<span>{{ $t('blockedUsers') }}</span>
		<mk-pagination :pagination="blockingPagination" class="blocking">
			<template #empty><span>{{ $t('noUsers') }}</span></template>
			<template #default="{items}">
				<div class="user" v-for="(block, i) in items" :key="block.id">
					<router-link class="name" :to="block.blockee | userPage">
						<mk-acct :user="block.blockee"/>
					</router-link>
				</div>
			</template>
		</mk-pagination>
	</div>
</section>
</template>

<script lang="ts">
import Vue from 'vue';
import { faBan } from '@fortawesome/free-solid-svg-icons';
import MkPagination from '../../components/ui/pagination.vue';
import i18n from '../../i18n';

export default Vue.extend({
	i18n,

	components: {
		MkPagination,
	},

	data() {
		return {
			mutingPagination: {
				endpoint: 'mute/list',
				limit: 10,
			},
			blockingPagination: {
				endpoint: 'blocking/list',
				limit: 10,
			},
			faBan
		}
	},
});
</script>

<style lang="scss" scoped>
.rrfwjxfl {
	> ._content {
		max-height: 350px;
		overflow: auto;

		> .muting,
		> .blocking {
			> .empty {
				opacity: 0.5 !important;
			}
		}
	}
}
</style>