summaryrefslogtreecommitdiff
path: root/packages/client/src/pages/emojis.vue
blob: 886b5f711926666060bc59dac6b515aa77eaf200 (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>
<div :class="$style.root">
	<XCategory v-if="tab === 'category'"/>
</div>
</template>

<script lang="ts" setup>
import { ref, computed } from 'vue';
import * as os from '@/os';
import * as symbols from '@/symbols';
import XCategory from './emojis.category.vue';
import { i18n } from '@/i18n';

const tab = ref('category');

function menu(ev) {
	os.popupMenu([{
		icon: 'fas fa-download',
		text: i18n.ts.export,
		action: async () => {
			os.api('export-custom-emojis', {
			})
			.then(() => {
				os.alert({
					type: 'info',
					text: i18n.ts.exportRequested,
				});
			}).catch((e) => {
				os.alert({
					type: 'error',
					text: e.message,
				});
			});
		}
	}], ev.currentTarget ?? ev.target);
}

defineExpose({
	[symbols.PAGE_INFO]: {
		title: i18n.ts.customEmojis,
		icon: 'fas fa-laugh',
		bg: 'var(--bg)',
		actions: [{
			icon: 'fas fa-ellipsis-h',
			handler: menu,
		}],
	},
});
</script>

<style lang="scss" module>
.root {
	max-width: 1000px;
	margin: 0 auto;
}
</style>