aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat_title/chat_title.vue
blob: 68ee7a5aba26b0d110f59c625198cc93efb9a3f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
  <div
    class="chat-title"
    :title="title"
  >
    <UserPopover
      v-if="withAvatar && user"
      class="avatar-container"
      :user-id="user.id"
    >
      <UserAvatar
        class="titlebar-avatar"
        :user="user"
      />
    </UserPopover>
    <RichContent
      v-if="user"
      class="username"
      :title="'@'+(user && user.screen_name_ui)"
      :html="htmlTitle"
      :emoji="user.emoji || []"
    />
  </div>
</template>

<script src="./chat_title.js"></script>

<style lang="scss">
.chat-title {
  display: flex;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  --emoji-size: 14px;

  .username {
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline;
    word-wrap: break-word;
    overflow: hidden;
  }

  .avatar-container {
    align-self: center;
    line-height: 1;
  }

  .titlebar-avatar {
    margin-right: 0.5em;
    height: 1.5em;
    width: 1.5em;
    border-radius: var(--roundness);

    &.animated::before {
      display: none;
    }
  }
}
</style>