2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
<template>
|
2023-05-08 01:32:08 +00:00
|
|
|
<div class="_panel" :class="$style.root">
|
|
|
|
<div :class="$style.banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl})` : ''"></div>
|
|
|
|
<MkAvatar :class="$style.avatar" :user="user" indicator/>
|
|
|
|
<div :class="$style.title">
|
|
|
|
<MkA :class="$style.name" :to="userPage(user)"><MkUserName :user="user" :nowrap="false"/></MkA>
|
|
|
|
<p :class="$style.username"><MkAcct :user="user"/></p>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
2023-05-08 01:32:08 +00:00
|
|
|
<span v-if="$i && $i.id !== user.id && user.isFollowed" :class="$style.followed">{{ i18n.ts.followsYou }}</span>
|
|
|
|
<div :class="$style.description">
|
2023-06-02 02:03:59 +00:00
|
|
|
<div v-if="user.description" :class="$style.mfm">
|
2022-12-29 01:14:44 +00:00
|
|
|
<Mfm :text="user.description" :author="user" :i="$i"/>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
2022-07-20 13:24:26 +00:00
|
|
|
<span v-else style="opacity: 0.7;">{{ i18n.ts.noAccountDescription }}</span>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
2023-05-08 01:32:08 +00:00
|
|
|
<div :class="$style.status">
|
|
|
|
<div :class="$style.statusItem">
|
2023-07-18 22:10:12 +00:00
|
|
|
<p :class="$style.statusItemLabel">{{ i18n.ts.notes }}</p><span :class="$style.statusItemValue">{{ number(user.notesCount) }}</span>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
2023-07-18 10:50:23 +00:00
|
|
|
<div v-if="isFfVisibleForMe(user)" :class="$style.statusItem">
|
2023-07-18 22:10:12 +00:00
|
|
|
<p :class="$style.statusItemLabel">{{ i18n.ts.following }}</p><span :class="$style.statusItemValue">{{ number(user.followingCount) }}</span>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
2023-07-18 10:50:23 +00:00
|
|
|
<div v-if="isFfVisibleForMe(user)" :class="$style.statusItem">
|
2023-07-18 22:10:12 +00:00
|
|
|
<p :class="$style.statusItemLabel">{{ i18n.ts.followers }}</p><span :class="$style.statusItemValue">{{ number(user.followersCount) }}</span>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-05-08 01:32:08 +00:00
|
|
|
<MkFollowButton v-if="$i && user.id != $i.id" :class="$style.follow" :user="user" mini/>
|
2020-10-17 11:12:00 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-07 06:02:25 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import * as misskey from 'misskey-js';
|
2022-08-30 15:24:33 +00:00
|
|
|
import MkFollowButton from '@/components/MkFollowButton.vue';
|
2023-07-18 22:10:12 +00:00
|
|
|
import number from '@/filters/number';
|
2021-11-11 17:02:25 +00:00
|
|
|
import { userPage } from '@/filters/user';
|
2022-07-20 13:24:26 +00:00
|
|
|
import { i18n } from '@/i18n';
|
2023-04-01 04:52:07 +00:00
|
|
|
import { $i } from '@/account';
|
2023-07-18 10:50:23 +00:00
|
|
|
import { isFfVisibleForMe } from '@/scripts/isFfVisibleForMe';
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-01-07 06:02:25 +00:00
|
|
|
defineProps<{
|
|
|
|
user: misskey.entities.UserDetailed;
|
|
|
|
}>();
|
2020-10-17 11:12:00 +00:00
|
|
|
</script>
|
|
|
|
|
2023-05-08 01:32:08 +00:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2020-10-17 11:12:00 +00:00
|
|
|
position: relative;
|
2023-05-08 01:32:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.banner {
|
|
|
|
height: 84px;
|
|
|
|
background-color: rgba(0, 0, 0, 0.1);
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 62px;
|
|
|
|
left: 13px;
|
|
|
|
z-index: 2;
|
|
|
|
width: 58px;
|
|
|
|
height: 58px;
|
|
|
|
border: solid 4px var(--panel);
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
display: block;
|
|
|
|
padding: 10px 0 10px 88px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
display: inline-block;
|
|
|
|
margin: 0;
|
|
|
|
font-weight: bold;
|
|
|
|
line-height: 16px;
|
|
|
|
word-break: break-all;
|
|
|
|
}
|
|
|
|
|
|
|
|
.username {
|
|
|
|
display: block;
|
|
|
|
margin: 0;
|
|
|
|
line-height: 16px;
|
|
|
|
font-size: 0.8em;
|
|
|
|
color: var(--fg);
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
|
|
|
.followed {
|
|
|
|
position: absolute;
|
|
|
|
top: 12px;
|
|
|
|
left: 12px;
|
|
|
|
padding: 4px 8px;
|
|
|
|
color: #fff;
|
|
|
|
background: rgba(0, 0, 0, 0.7);
|
|
|
|
font-size: 0.7em;
|
|
|
|
border-radius: 6px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.description {
|
|
|
|
padding: 16px;
|
|
|
|
font-size: 0.8em;
|
|
|
|
border-top: solid 0.5px var(--divider);
|
|
|
|
}
|
|
|
|
|
|
|
|
.mfm {
|
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-line-clamp: 3;
|
2023-05-19 09:16:26 +00:00
|
|
|
-webkit-box-orient: vertical;
|
2023-05-08 01:32:08 +00:00
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status {
|
|
|
|
padding: 10px 16px;
|
|
|
|
border-top: solid 0.5px var(--divider);
|
|
|
|
}
|
|
|
|
|
|
|
|
.statusItem {
|
|
|
|
display: inline-block;
|
|
|
|
width: 33%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.statusItemLabel {
|
|
|
|
margin: 0;
|
|
|
|
font-size: 0.7em;
|
|
|
|
color: var(--fg);
|
|
|
|
}
|
|
|
|
|
|
|
|
.statusItemValue {
|
|
|
|
font-size: 1em;
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2023-05-08 01:32:08 +00:00
|
|
|
.follow {
|
2023-05-09 06:33:50 +00:00
|
|
|
position: absolute !important;
|
2023-05-08 01:32:08 +00:00
|
|
|
top: 8px;
|
|
|
|
right: 8px;
|
2020-10-17 11:12:00 +00:00
|
|
|
}
|
|
|
|
</style>
|