2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2023-05-08 10:29:19 +02:00
|
|
|
<template>
|
|
|
|
<div v-adaptive-bg class="_panel" style="position: relative;">
|
|
|
|
<div :class="$style.banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl})` : ''"></div>
|
|
|
|
<MkAvatar :class="$style.avatar" :user="user" indicator/>
|
|
|
|
<div :class="$style.title">
|
|
|
|
<div :class="$style.name"><MkUserName :user="user" :nowrap="false"/></div>
|
|
|
|
<p :class="$style.username"><MkAcct :user="user"/></p>
|
|
|
|
</div>
|
|
|
|
<div :class="$style.description">
|
|
|
|
<div v-if="user.description" :class="$style.mfm">
|
2024-06-07 12:01:49 +02:00
|
|
|
<Mfm :text="user.description" :isBlock="true" :author="user"/>
|
2023-05-08 10:29:19 +02:00
|
|
|
</div>
|
|
|
|
<span v-else style="opacity: 0.7;">{{ i18n.ts.noAccountDescription }}</span>
|
|
|
|
</div>
|
|
|
|
<div :class="$style.footer">
|
2024-06-21 13:42:33 +02:00
|
|
|
<MkButton v-if="!isFollowing" primary gradate rounded full @click="follow"><i class="ti ti-plus"></i> {{ i18n.ts.follow }}</MkButton>
|
2024-06-21 14:09:24 +02:00
|
|
|
<div v-else style="opacity: 0.7; text-align: center;">{{ i18n.ts.youFollowing }} <i class="ti ti-check"></i></div>
|
2023-05-08 10:29:19 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-09-04 06:33:38 +02:00
|
|
|
import * as Misskey from 'misskey-js';
|
2023-05-08 10:29:19 +02:00
|
|
|
import { ref } from 'vue';
|
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { i18n } from '@/i18n.js';
|
2024-01-04 10:32:46 +01:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-05-08 10:29:19 +02:00
|
|
|
|
|
|
|
const props = defineProps<{
|
2023-09-04 06:33:38 +02:00
|
|
|
user: Misskey.entities.UserDetailed;
|
2023-05-08 10:29:19 +02:00
|
|
|
}>();
|
|
|
|
|
|
|
|
const isFollowing = ref(false);
|
|
|
|
|
|
|
|
async function follow() {
|
|
|
|
isFollowing.value = true;
|
2024-01-04 10:32:46 +01:00
|
|
|
misskeyApi('following/create', {
|
2023-05-08 10:29:19 +02:00
|
|
|
userId: props.user.id,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.banner {
|
|
|
|
height: 60px;
|
|
|
|
background-color: rgba(0, 0, 0, 0.1);
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 30px;
|
|
|
|
left: 13px;
|
|
|
|
z-index: 2;
|
2024-01-01 17:44:13 +01:00
|
|
|
width: var(--avatar);
|
|
|
|
height: var(--avatar);
|
2023-05-08 10:29:19 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
.description {
|
|
|
|
padding: 0 16px 16px 88px;
|
|
|
|
font-size: 0.9em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mfm {
|
|
|
|
display: -webkit-box;
|
|
|
|
-webkit-line-clamp: 5;
|
2023-07-08 00:08:16 +02:00
|
|
|
-webkit-box-orient: vertical;
|
2023-05-08 10:29:19 +02:00
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.footer {
|
|
|
|
border-top: solid 0.5px var(--divider);
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
</style>
|