summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkNotification.vue
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-11-02 19:59:18 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-11-02 19:59:18 +0900
commitd20f778bd0a92fa9d3a489964f8e75981e4aadeb (patch)
tree53ecae77f61ac167fef24a6c5c65c9ab27fac7d6 /packages/frontend/src/components/MkNotification.vue
parentRevert "enhance(frontend): 「内容を隠す」でリアクションも隠... (diff)
downloadmisskey-d20f778bd0a92fa9d3a489964f8e75981e4aadeb.tar.gz
misskey-d20f778bd0a92fa9d3a489964f8e75981e4aadeb.tar.bz2
misskey-d20f778bd0a92fa9d3a489964f8e75981e4aadeb.zip
enhance(frontend): tweak MkNotification
Diffstat (limited to 'packages/frontend/src/components/MkNotification.vue')
-rw-r--r--packages/frontend/src/components/MkNotification.vue19
1 files changed, 3 insertions, 16 deletions
diff --git a/packages/frontend/src/components/MkNotification.vue b/packages/frontend/src/components/MkNotification.vue
index ff20bc591f..fcf4791240 100644
--- a/packages/frontend/src/components/MkNotification.vue
+++ b/packages/frontend/src/components/MkNotification.vue
@@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
-<div ref="elRef" :class="$style.root">
+<div :class="$style.root">
<div :class="$style.head">
<MkAvatar v-if="notification.type === 'pollEnded'" :class="$style.icon" :user="notification.note.user" link preview/>
<MkAvatar v-else-if="notification.type === 'note'" :class="$style.icon" :user="notification.note.user" link preview/>
@@ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<!-- notification.reaction が null になることはまずないが、ここでoptional chaining使うと一部ブラウザで刺さるので念の為 -->
<MkReactionIcon
v-else-if="notification.type === 'reaction'"
- ref="reactionRef"
+ :withTooltip="true"
:reaction="notification.reaction ? notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : notification.reaction"
:noStyle="true"
style="width: 100%; height: 100%;"
@@ -111,6 +111,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkAvatar :class="$style.reactionsItemAvatar" :user="reaction.user" link preview/>
<div :class="$style.reactionsItemReaction">
<MkReactionIcon
+ :withTooltip="true"
:reaction="reaction.reaction ? reaction.reaction.replace(/^:(\w+):$/, ':$1@.:') : reaction.reaction"
:noStyle="true"
style="width: 100%; height: 100%;"
@@ -133,14 +134,12 @@ import { ref, shallowRef } from 'vue';
import * as Misskey from 'misskey-js';
import MkReactionIcon from '@/components/MkReactionIcon.vue';
import MkFollowButton from '@/components/MkFollowButton.vue';
-import XReactionTooltip from '@/components/MkReactionTooltip.vue';
import MkButton from '@/components/MkButton.vue';
import { getNoteSummary } from '@/scripts/get-note-summary.js';
import { notePage } from '@/filters/note.js';
import { userPage } from '@/filters/user.js';
import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
-import { useTooltip } from '@/scripts/use-tooltip.js';
import { $i } from '@/account.js';
import { infoImageUrl } from '@/instance.js';
@@ -153,9 +152,6 @@ const props = withDefaults(defineProps<{
full: false,
});
-const elRef = shallowRef<HTMLElement>(null);
-const reactionRef = ref(null);
-
const followRequestDone = ref(false);
const acceptFollowRequest = () => {
@@ -167,15 +163,6 @@ const rejectFollowRequest = () => {
followRequestDone.value = true;
os.api('following/requests/reject', { userId: props.notification.user.id });
};
-
-useTooltip(reactionRef, (showing) => {
- os.popup(XReactionTooltip, {
- showing,
- reaction: props.notification.reaction ? props.notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : props.notification.reaction,
- emojis: props.notification.note.emojis,
- targetElement: reactionRef.value.$el,
- }, {}, 'closed');
-});
</script>
<style lang="scss" module>