add withLink option to MkUserCardMini.vue
This commit is contained in:
parent
534fc2b75d
commit
c650c575dc
1 changed files with 7 additions and 4 deletions
|
|
@ -5,11 +5,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-adaptive-bg :class="[$style.root]">
|
<div v-adaptive-bg :class="[$style.root]">
|
||||||
<MkAvatar :class="$style.avatar" :user="user" indicator/>
|
<MkAvatar :class="$style.avatar" :user="user" indicator :preview="withLink" :link="withLink"/>
|
||||||
<div :class="$style.body">
|
<component :is="withLink ? MkA : 'div'" :class="$style.body" :to="userPage(user)">
|
||||||
<span :class="$style.name"><MkUserName :user="user"/></span>
|
<span :class="$style.name"><MkUserName :user="user"/></span>
|
||||||
<span :class="$style.sub"><span class="_monospace">@{{ acct(user) }}</span></span>
|
<span :class="$style.sub"><span class="_monospace">@{{ acct(user) }}</span></span>
|
||||||
</div>
|
</component>
|
||||||
<MkMiniChart v-if="chartValues" :class="$style.chart" :src="chartValues"/>
|
<MkMiniChart v-if="chartValues" :class="$style.chart" :src="chartValues"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -18,14 +18,17 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import MkMiniChart from '@/components/MkMiniChart.vue';
|
import MkMiniChart from '@/components/MkMiniChart.vue';
|
||||||
|
import MkA from '@/components/global/MkA.vue';
|
||||||
import { misskeyApiGet } from '@/utility/misskey-api.js';
|
import { misskeyApiGet } from '@/utility/misskey-api.js';
|
||||||
import { acct } from '@/filters/user.js';
|
import { acct, userPage } from '@/filters/user.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
user: Misskey.entities.User;
|
user: Misskey.entities.User;
|
||||||
withChart?: boolean;
|
withChart?: boolean;
|
||||||
|
withLink?: boolean;
|
||||||
}>(), {
|
}>(), {
|
||||||
withChart: true,
|
withChart: true,
|
||||||
|
withLink: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const chartValues = ref<number[] | null>(null);
|
const chartValues = ref<number[] | null>(null);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue