Make UserCardMini clickable

This commit is contained in:
Freeplay 2023-05-19 14:45:29 -04:00
parent 5db7460a82
commit f573f93d16
1 changed files with 9 additions and 3 deletions

View File

@ -1,10 +1,11 @@
<template>
<div
<MkA
class="user-card-mini"
:class="[
$style.root,
{ yellow: user.isSilenced, red: user.isSuspended, gray: false },
]"
:to="userPage(user)"
>
<MkAvatar
class="avatar"
@ -19,14 +20,14 @@
>
</div>
<MkMiniChart v-if="chartValues" class="chart" :src="chartValues" />
</div>
</MkA>
</template>
<script lang="ts" setup>
import * as misskey from "calckey-js";
import MkMiniChart from "@/components/MkMiniChart.vue";
import * as os from "@/os";
import { acct } from "@/filters/user";
import { acct, userPage } from "@/filters/user";
const props = withDefaults(defineProps<{
user: misskey.entities.User;
@ -62,6 +63,7 @@ if (props.withChart) {
padding: 16px;
background: var(--panel);
border-radius: 8px;
transition: background .2s;
> :global(.avatar) {
display: block;
@ -102,6 +104,10 @@ if (props.withChart) {
height: 30px;
}
&:hover, &:focus {
background: var(--panelHighlight);
}
&:global(.yellow) {
--c: rgb(255 196 0 / 15%);
background-image: linear-gradient(