2018-02-07 10:34:43 +01:00
|
|
|
<template>
|
2022-12-30 06:10:00 +01:00
|
|
|
<Transition :name="$store.state.animation ? 'y' : ''">
|
|
|
|
<div v-if="Object.keys(note.reactions).length > 0" class="tdflqwzn" :class="{ isMe }">
|
2022-12-30 05:52:40 +01:00
|
|
|
<TransitionGroup :name="$store.state.animation ? 'x' : ''">
|
|
|
|
<XReaction v-for="(count, reaction) in note.reactions" :key="reaction" :reaction="reaction" :count="count" :is-initial="initialReactions.has(reaction)" :note="note"/>
|
|
|
|
</TransitionGroup>
|
2018-02-07 10:34:43 +01:00
|
|
|
</div>
|
2022-12-30 06:10:00 +01:00
|
|
|
</Transition>
|
2018-02-07 10:34:43 +01:00
|
|
|
</template>
|
|
|
|
|
2022-01-12 18:55:19 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue';
|
|
|
|
import * as misskey from 'misskey-js';
|
|
|
|
import { $i } from '@/account';
|
2022-08-30 17:24:33 +02:00
|
|
|
import XReaction from '@/components/MkReactionsViewer.reaction.vue';
|
2018-11-08 19:44:35 +01:00
|
|
|
|
2022-01-12 18:55:19 +01:00
|
|
|
const props = defineProps<{
|
|
|
|
note: misskey.entities.Note;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const initialReactions = new Set(Object.keys(props.note.reactions));
|
|
|
|
|
|
|
|
const isMe = computed(() => $i && $i.id === props.note.userId);
|
2018-02-07 10:41:48 +01:00
|
|
|
</script>
|
|
|
|
|
2022-12-27 10:29:39 +01:00
|
|
|
<style lang="scss" scoped>
|
2022-12-30 06:10:00 +01:00
|
|
|
.y-enter-active, .y-leave-active {
|
|
|
|
overflow: clip;
|
|
|
|
max-height: 36px;
|
|
|
|
transition: opacity 0.2s cubic-bezier(0,.5,.5,1), max-height 0.2s cubic-bezier(0,.5,.5,1) !important;
|
|
|
|
}
|
|
|
|
.y-enter-from, .y-leave-to {
|
|
|
|
max-height: 0px;
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
2022-12-30 05:52:40 +01:00
|
|
|
.x-move, .x-enter-active, .x-leave-active {
|
|
|
|
transition: opacity 0.2s cubic-bezier(0,.5,.5,1), transform 0.2s cubic-bezier(0,.5,.5,1) !important;
|
|
|
|
}
|
|
|
|
.x-enter-from, .x-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale(0.7);
|
|
|
|
}
|
|
|
|
.x-leave-active {
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
|
2020-02-21 22:43:46 +01:00
|
|
|
.tdflqwzn {
|
2020-01-29 20:37:25 +01:00
|
|
|
margin: 4px -2px 0 -2px;
|
2018-02-07 10:41:48 +01:00
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
&:empty {
|
|
|
|
display: none;
|
|
|
|
}
|
2018-02-07 10:41:48 +01:00
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
&.isMe {
|
|
|
|
> span {
|
|
|
|
cursor: default !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-07 10:41:48 +01:00
|
|
|
</style>
|