2021-09-17 13:39:15 +00:00
|
|
|
<template>
|
|
|
|
<button class="zuvgdzyu _button" @click="menu">
|
|
|
|
<img :src="emoji.url" class="img" :alt="emoji.name"/>
|
|
|
|
<div class="body">
|
|
|
|
<div class="name _monospace">{{ emoji.name }}</div>
|
|
|
|
<div class="info">{{ emoji.aliases.join(' ') }}</div>
|
|
|
|
</div>
|
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
|
2022-01-12 17:36:51 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import * as os from '@/os';
|
|
|
|
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
2022-01-12 17:36:51 +00:00
|
|
|
import { i18n } from '@/i18n';
|
2021-09-17 13:39:15 +00:00
|
|
|
|
2022-01-12 17:36:51 +00:00
|
|
|
const props = defineProps<{
|
|
|
|
emoji: Record<string, unknown>; // TODO
|
|
|
|
}>();
|
2021-09-17 13:39:15 +00:00
|
|
|
|
2022-01-12 17:36:51 +00:00
|
|
|
function menu(ev) {
|
|
|
|
os.popupMenu([{
|
|
|
|
type: 'label',
|
|
|
|
text: ':' + props.emoji.name + ':',
|
|
|
|
}, {
|
2022-01-28 02:39:49 +00:00
|
|
|
text: i18n.ts.copy,
|
2022-11-07 02:30:26 +00:00
|
|
|
icon: 'ph-clipboard-text-bold',
|
2022-01-12 17:36:51 +00:00
|
|
|
action: () => {
|
|
|
|
copyToClipboard(`:${props.emoji.name}:`);
|
|
|
|
os.success();
|
2021-09-17 13:39:15 +00:00
|
|
|
}
|
2022-01-28 02:53:12 +00:00
|
|
|
}], ev.currentTarget ?? ev.target);
|
2022-01-12 17:36:51 +00:00
|
|
|
}
|
2021-09-17 13:39:15 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.zuvgdzyu {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 12px;
|
|
|
|
text-align: left;
|
|
|
|
background: var(--panel);
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
border-color: var(--accent);
|
|
|
|
}
|
|
|
|
|
|
|
|
> .img {
|
|
|
|
width: 42px;
|
|
|
|
height: 42px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
padding: 0 0 0 8px;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .info {
|
|
|
|
opacity: 0.5;
|
|
|
|
font-size: 0.9em;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|