akkoma-fe/src/components/chat_title/chat_title.vue

66 lines
1.2 KiB
Vue
Raw Normal View History

2020-05-07 13:10:53 +00:00
<template>
<div
class="chat-title"
:title="title"
>
<router-link
v-if="withAvatar && user"
2022-06-15 15:58:02 +00:00
class="avatar-container"
:to="getUserProfileLink(user)"
>
<UserAvatar
2022-04-12 14:17:52 +00:00
class="titlebar-avatar"
:user="user"
/>
</router-link>
2022-02-19 20:22:21 +00:00
<RichContent
v-if="user"
2020-05-07 13:10:53 +00:00
class="username"
2022-04-05 14:44:30 +00:00
:title="'@'+(user && user.screen_name_ui)"
2022-02-19 20:22:21 +00:00
:html="htmlTitle"
:emoji="user.emoji || []"
2020-05-07 13:10:53 +00:00
/>
</div>
</template>
<script src="./chat_title.js"></script>
<style lang="scss">
@import '../../_variables.scss';
.chat-title {
display: flex;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2022-02-19 20:22:21 +00:00
--emoji-size: 14px;
2020-05-07 13:10:53 +00:00
.username {
max-width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
display: inline;
word-wrap: break-word;
overflow: hidden;
2020-05-07 13:10:53 +00:00
}
2022-04-12 14:17:52 +00:00
.avatar-container {
align-self: center;
2022-04-20 17:16:41 +00:00
line-height: 1;
2022-04-12 14:17:52 +00:00
}
2022-04-12 14:17:52 +00:00
.titlebar-avatar {
margin-right: 0.5em;
height: 1.5em;
width: 1.5em;
border-radius: $fallback--avatarAltRadius;
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
&.animated::before {
display: none;
}
}
2020-05-07 13:10:53 +00:00
}
</style>