2021-08-07 03:23:59 +02:00
|
|
|
<template>
|
2021-10-23 21:03:07 +02:00
|
|
|
<div :class="$style.root">
|
|
|
|
<XCategory v-if="tab === 'category'"/>
|
2021-09-20 21:09:28 +02:00
|
|
|
</div>
|
2021-08-07 03:23:59 +02:00
|
|
|
</template>
|
|
|
|
|
2022-01-12 18:36:51 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { ref, computed } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2021-09-17 15:39:15 +02:00
|
|
|
import XCategory from './emojis.category.vue';
|
2022-01-12 18:36:51 +01:00
|
|
|
import { i18n } from '@/i18n';
|
2021-08-07 03:23:59 +02:00
|
|
|
|
2022-01-12 18:36:51 +01:00
|
|
|
const tab = ref('category');
|
2021-08-07 03:23:59 +02:00
|
|
|
|
2022-01-12 18:36:51 +01:00
|
|
|
function menu(ev) {
|
|
|
|
os.popupMenu([{
|
|
|
|
icon: 'fas fa-download',
|
2022-01-28 03:39:49 +01:00
|
|
|
text: i18n.ts.export,
|
2022-01-12 18:36:51 +01:00
|
|
|
action: async () => {
|
|
|
|
os.api('export-custom-emojis', {
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
os.alert({
|
|
|
|
type: 'info',
|
2022-01-28 03:39:49 +01:00
|
|
|
text: i18n.ts.exportRequested,
|
2022-01-12 18:36:51 +01:00
|
|
|
});
|
|
|
|
}).catch((e) => {
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
|
|
|
text: e.message,
|
|
|
|
});
|
|
|
|
});
|
2021-08-07 03:23:59 +02:00
|
|
|
}
|
2022-01-28 03:53:12 +01:00
|
|
|
}], ev.currentTarget ?? ev.target);
|
2022-01-12 18:36:51 +01:00
|
|
|
}
|
2021-12-10 10:24:26 +01:00
|
|
|
|
2022-01-12 18:36:51 +01:00
|
|
|
defineExpose({
|
|
|
|
[symbols.PAGE_INFO]: {
|
2022-01-28 03:39:49 +01:00
|
|
|
title: i18n.ts.customEmojis,
|
2022-01-12 18:36:51 +01:00
|
|
|
icon: 'fas fa-laugh',
|
|
|
|
bg: 'var(--bg)',
|
|
|
|
actions: [{
|
|
|
|
icon: 'fas fa-ellipsis-h',
|
|
|
|
handler: menu,
|
|
|
|
}],
|
|
|
|
},
|
2021-08-07 03:23:59 +02:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2021-09-20 21:09:28 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
|
|
|
max-width: 1000px;
|
|
|
|
margin: 0 auto;
|
|
|
|
}
|
2021-08-07 03:23:59 +02:00
|
|
|
</style>
|