chore: reduce size

This commit is contained in:
Anthony Fu 2023-01-16 11:21:38 +01:00
parent e9e7257356
commit 3c4af4f5ea
2 changed files with 11 additions and 13 deletions

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import { Emoji } from 'emoji-mart'
export interface SearchEmoji {
title: string
src: string
@ -12,18 +10,13 @@ defineProps<{
</script>
<template>
<div flex gap-2 items-center>
<div flex="~ gap3" items-center text-base>
<img
:key="emoji.title"
width="30"
height="30"
width="20"
height="20"
:src="emoji.src"
loading="lazy"
>
<div flex="~ col gap1" pt-1 pl-2 shrink h-full overflow-hidden leading-none>
<div flex="~" gap-2>
<span text-lg>:{{ emoji.title }}:</span>
</div>
</div>
<span shrink overflow-hidden leading-none text-base><span text-secondary>:</span>{{ emoji.title }}<span text-secondary>:</span></span>
</div>
</template>

View file

@ -3,7 +3,7 @@ import { getEmojiMatchesInText } from '@iconify/utils/lib/emoji/replace/find'
import CommonScrollIntoView from '../common/CommonScrollIntoView.vue'
import type { CustomEmoji, Emoji } from '~~/composables/tiptap/suggestion'
import { isCustomEmoji } from '~~/composables/tiptap/suggestion'
import { emojiFilename, emojiPrefix, emojiRegEx, getEmojiAttributes } from '~~/config/emojis'
import { emojiFilename, emojiPrefix, emojiRegEx } from '~~/config/emojis'
const { items, command } = defineProps<{
items: (CustomEmoji | Emoji)[]
@ -68,7 +68,12 @@ defineExpose({
</script>
<template>
<div v-if="isPending || items.length" relative bg-base text-base shadow border="~ base rounded" text-sm py-2 overflow-x-hidden overflow-y-auto max-h-100>
<div
v-if="isPending || items.length"
relative bg-base text-base shadow border="~ base rounded"
text-sm py-2 overflow-x-hidden overflow-y-auto max-h-100
min-w-40 max-w-50
>
<template v-if="isPending">
<div flex gap-1 items-center p2 animate-pulse>
<div i-ri:loader-2-line animate-spin />