2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
<template>
|
2023-05-08 03:32:08 +02: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 13:12:00 +02:00
|
|
|
</div>
|
2023-05-08 03:32:08 +02: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 04:03:59 +02:00
|
|
|
<div v-if="user.description" :class="$style.mfm">
|
2022-12-29 02:14:44 +01:00
|
|
|
<Mfm :text="user.description" :author="user" :i="$i"/>
|
2020-10-17 13:12:00 +02:00
|
|
|
</div>
|
2022-07-20 15:24:26 +02:00
|
|
|
<span v-else style="opacity: 0.7;">{{ i18n.ts.noAccountDescription }}</span>
|
2020-10-17 13:12:00 +02:00
|
|
|
</div>
|
2023-05-08 03:32:08 +02:00
|
|
|
<div :class="$style.status">
|
|
|
|
<div :class="$style.statusItem">
|
2023-07-19 00:10:12 +02:00
|
|
|
<p :class="$style.statusItemLabel">{{ i18n.ts.notes }}</p><span :class="$style.statusItemValue">{{ number(user.notesCount) }}</span>
|
2020-10-17 13:12:00 +02:00
|
|
|
</div>
|
2023-07-18 12:50:23 +02:00
|
|
|
<div v-if="isFfVisibleForMe(user)" :class="$style.statusItem">
|
2023-07-19 00:10:12 +02:00
|
|
|
<p :class="$style.statusItemLabel">{{ i18n.ts.following }}</p><span :class="$style.statusItemValue">{{ number(user.followingCount) }}</span>
|
2020-10-17 13:12:00 +02:00
|
|
|
</div>
|
2023-07-18 12:50:23 +02:00
|
|
|
<div v-if="isFfVisibleForMe(user)" :class="$style.statusItem">
|
2023-07-19 00:10:12 +02:00
|
|
|
<p :class="$style.statusItemLabel">{{ i18n.ts.followers }}</p><span :class="$style.statusItemValue">{{ number(user.followersCount) }}</span>
|
2020-10-17 13:12:00 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-05-08 03:32:08 +02:00
|
|
|
<MkFollowButton v-if="$i && user.id != $i.id" :class="$style.follow" :user="user" mini/>
|
2020-10-17 13:12:00 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-07 07:02:25 +01:00
|
|
|
<script lang="ts" setup>
|
2023-09-04 06:33:38 +02:00
|
|
|
import * as Misskey from 'misskey-js';
|
2022-08-30 17:24:33 +02:00
|
|
|
import MkFollowButton from '@/components/MkFollowButton.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import number from '@/filters/number.js';
|
|
|
|
import { userPage } from '@/filters/user.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { $i } from '@/account.js';
|
|
|
|
import { isFfVisibleForMe } from '@/scripts/isFfVisibleForMe.js';
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2022-01-07 07:02:25 +01:00
|
|
|
defineProps<{
|
2023-09-04 06:33:38 +02:00
|
|
|
user: Misskey.entities.UserDetailed;
|
2022-01-07 07:02:25 +01:00
|
|
|
}>();
|
2020-10-17 13:12:00 +02:00
|
|
|
</script>
|
|
|
|
|
2023-05-08 03:32:08 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2020-10-17 13:12:00 +02:00
|
|
|
position: relative;
|
2023-05-08 03:32:08 +02: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 11:16:26 +02:00
|
|
|
-webkit-box-orient: vertical;
|
2023-05-08 03:32:08 +02: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 13:12:00 +02:00
|
|
|
|
2023-05-08 03:32:08 +02:00
|
|
|
.follow {
|
2023-05-09 08:33:50 +02:00
|
|
|
position: absolute !important;
|
2023-05-08 03:32:08 +02:00
|
|
|
top: 8px;
|
|
|
|
right: 8px;
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
|
|
|
</style>
|