This commit is contained in:
syuilo 2024-08-29 17:57:49 +09:00
parent cf3245b59c
commit 4c79716688
4 changed files with 7 additions and 17 deletions

View file

@ -4,13 +4,13 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<a ref="el" :href="to" target="_blank" rel="noopener">
<a :href="to" target="_blank" rel="noopener">
<slot></slot>
</a>
</template>
<script lang="ts" setup>
import { computed, inject, shallowRef } from 'vue';
import { } from 'vue';
const props = withDefaults(defineProps<{
to: string;
@ -18,8 +18,4 @@ const props = withDefaults(defineProps<{
}>(), {
activeClass: null,
});
const el = shallowRef<HTMLElement>();
defineExpose({ $el: el });
</script>

View file

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<component :is="link ? EmA : 'span'" v-bind="bound" class="_noSelect" :class="[$style.root, { [$style.cat]: user.isCat }]" @click="onClick">
<component :is="link ? EmA : 'span'" v-bind="bound" class="_noSelect" :class="[$style.root, { [$style.cat]: user.isCat }]">
<EmImgWithBlurhash :class="$style.inner" :src="url" :hash="user.avatarBlurhash" :cover="true" :onlyAvgColor="true"/>
<div v-if="user.isCat" :class="[$style.ears]">
<div :class="$style.earLeft">
@ -45,12 +45,10 @@ import { userPage } from '@/utils.js';
const props = withDefaults(defineProps<{
user: Misskey.entities.User;
target?: string | null;
link?: boolean;
preview?: boolean;
indicator?: boolean;
}>(), {
target: null,
link: false,
preview: false,
indicator: false,
@ -61,7 +59,7 @@ const emit = defineEmits<{
}>();
const bound = computed(() => props.link
? { to: userPage(props.user), target: props.target }
? { to: userPage(props.user) }
: {});
const url = computed(() => {
@ -69,11 +67,6 @@ const url = computed(() => {
return props.user.avatarUrl;
});
function onClick(ev: MouseEvent): void {
if (props.link) return;
emit('click', ev);
}
function getDecorationUrl(decoration: Omit<Misskey.entities.UserDetailed['avatarDecorations'][number], 'id'>) {
return decoration.url;
}

View file

@ -41,7 +41,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<article :class="$style.article">
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
<EmAvatar :class="$style.avatar" :user="appearNote.user"/>
<EmAvatar :class="$style.avatar" :user="appearNote.user" link/>
<div :class="$style.main">
<EmNoteHeader :note="appearNote" :mini="true"/>
<div style="container-type: inline-size;">

View file

@ -324,8 +324,9 @@ onUnmounted(() => {
z-index: 100;
top: 8px;
left: 8px;
padding: 6px 8px;
padding: 6px 10px;
border-radius: 6px;
font-size: 85%;
}
.embedCodeGenPreviewSpinner {