Add Chats

This commit is contained in:
eugenijm 2020-05-07 16:10:53 +03:00
parent a0ddcbdf5b
commit aa2cf51c05
69 changed files with 2794 additions and 161 deletions

View file

@ -0,0 +1,20 @@
import Vue from 'vue'
import ChatAvatar from '../chat_avatar/chat_avatar.vue'
export default Vue.component('chat-title', {
name: 'ChatTitle',
components: {
ChatAvatar
},
props: [
'user', 'withAvatar'
],
computed: {
title () {
return this.user ? this.user.screen_name : ''
},
htmlTitle () {
return this.user ? this.user.name_html : ''
}
}
})

View file

@ -0,0 +1,56 @@
<template>
<!-- eslint-disable vue/no-v-html -->
<div
class="chat-title"
:title="title"
>
<ChatAvatar
v-if="withAvatar"
:user="user"
width="23px"
height="23px"
/>
<span
v-if="withAvatar"
style="margin-right: 0.5em"
/>
<span
class="username"
v-html="htmlTitle"
/>
</div>
<!-- eslint-enable vue/no-v-html -->
</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;
a {
display: flex;
align-items: center;
}
.username {
max-width: 100%;
text-overflow: ellipsis;
white-space: nowrap;
display: inline;
word-wrap: break-word;
.emoji {
width: 14px;
height: 14px;
vertical-align: middle;
object-fit: contain
}
}
}
</style>