diff options
| author | eugenijm <eugenijm@protonmail.com> | 2020-06-21 17:13:29 +0300 |
|---|---|---|
| committer | eugenijm <eugenijm@protonmail.com> | 2020-07-08 15:21:31 +0300 |
| commit | f05f832bff58034d78de9478ae2dbb06284dea75 (patch) | |
| tree | e41f122ada5957618ea96e2b3206977ba8438fd8 /src/components/chat_title | |
| parent | aa2cf51c05ebdf411d74af5debbbc8fa4d3cf457 (diff) | |
Address feedback
Use more specific css rules for the emoji dimensions in the chat list status preview.
Use more round em value for chat list item height.
Add global html overflow and height for smoother chat navigation in
the desktop Safari.
Use offsetHeight instad of a computed style when setting the window height on resize.
Remove margin-bottom from the last message to avoid occasional layout shift in the desktop Safari
Use break-word to prevent chat message text overflow
Resize and scroll the textarea when inserting a new line on ctrl+enter
Remove fade transition on route change
Ensure proper border radius at the bottom of the chat, remove unused border-radius
Prevent the chat header "jumping" on the avatar load.
Diffstat (limited to 'src/components/chat_title')
| -rw-r--r-- | src/components/chat_title/chat_title.js | 10 | ||||
| -rw-r--r-- | src/components/chat_title/chat_title.vue | 39 |
2 files changed, 32 insertions, 17 deletions
diff --git a/src/components/chat_title/chat_title.js b/src/components/chat_title/chat_title.js index 2723d5f5..e424bb1f 100644 --- a/src/components/chat_title/chat_title.js +++ b/src/components/chat_title/chat_title.js @@ -1,10 +1,11 @@ import Vue from 'vue' -import ChatAvatar from '../chat_avatar/chat_avatar.vue' +import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator' +import UserAvatar from '../user_avatar/user_avatar.vue' export default Vue.component('chat-title', { name: 'ChatTitle', components: { - ChatAvatar + UserAvatar }, props: [ 'user', 'withAvatar' @@ -16,5 +17,10 @@ export default Vue.component('chat-title', { htmlTitle () { return this.user ? this.user.name_html : '' } + }, + methods: { + getUserProfileLink (user) { + return generateProfileLink(user.id, user.screen_name) + } } }) diff --git a/src/components/chat_title/chat_title.vue b/src/components/chat_title/chat_title.vue index fd42d125..cfd1e6d1 100644 --- a/src/components/chat_title/chat_title.vue +++ b/src/components/chat_title/chat_title.vue @@ -4,16 +4,16 @@ class="chat-title" :title="title" > - <ChatAvatar - v-if="withAvatar" - :user="user" - width="23px" - height="23px" - /> - <span - v-if="withAvatar" - style="margin-right: 0.5em" - /> + <router-link + v-if="withAvatar && user" + :to="getUserProfileLink(user)" + > + <UserAvatar + :user="user" + width="23px" + height="23px" + /> + </router-link> <span class="username" v-html="htmlTitle" @@ -32,11 +32,7 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - - a { - display: flex; - align-items: center; - } + align-items: center; .username { max-width: 100%; @@ -52,5 +48,18 @@ object-fit: contain } } + + .still-image.avatar { + width: 23px; + height: 23px; + margin-right: 0.5em; + + border-radius: $fallback--avatarAltRadius; + border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius); + + &.animated::before { + display: none; + } + } } </style> |
