summaryrefslogtreecommitdiff
path: root/src/client/components/reaction-icon.vue
blob: 368ddc0efcb4c75d5ab52f65963266a715a1c313 (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
<template>
<mk-emoji :emoji="reaction.startsWith(':') ? null : reaction" :name="reaction.startsWith(':') ? reaction.substr(1, reaction.length - 2) : null" :is-reaction="true" :custom-emojis="customEmojis" :normal="true" :no-style="noStyle"/>
</template>

<script lang="ts">
import Vue from 'vue';
import i18n from '../i18n';
export default Vue.extend({
	i18n,
	props: {
		reaction: {
			type: String,
			required: true
		},
		noStyle: {
			type: Boolean,
			required: false,
			default: false
		},
	},
	data() {
		return {
			customEmojis: []
		};
	},
	created() {
		this.$root.getMeta().then(meta => {
			if (meta && meta.emojis) this.customEmojis = meta.emojis;
		});
	},
});
</script>