enhancement: Updates icons to show last message type (#2743)

This commit is contained in:
Nithin David Thomas 2021-08-03 12:13:24 +05:30 committed by GitHub
parent faf104c1fe
commit 0475060245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 6 deletions

View file

@ -90,11 +90,6 @@
font-size: $font-size-mini;
vertical-align: top;
}
.message-from-agent {
color: $color-gray;
font-size: $font-size-mini;
}
}
.conversation--meta {

View file

@ -26,7 +26,12 @@
{{ currentContact.name }}
</h4>
<p v-if="lastMessageInChat" class="conversation--message">
<i v-if="messageByAgent" class="ion-ios-undo message-from-agent"></i>
<i v-if="isMessagePrivate" class="ion-locked last-message-icon" />
<i v-else-if="messageByAgent" class="ion-ios-undo last-message-icon" />
<i
v-else-if="isMessageAnActivity"
class="ion-information-circled last-message-icon"
/>
<span v-if="lastMessageInChat.content">
{{ parsedLastMessage }}
</span>
@ -144,6 +149,18 @@ export default {
return messageType === MESSAGE_TYPE.OUTGOING;
},
isMessageAnActivity() {
const lastMessage = this.lastMessageInChat;
const { message_type: messageType } = lastMessage;
return messageType === MESSAGE_TYPE.ACTIVITY;
},
isMessagePrivate() {
const lastMessage = this.lastMessageInChat;
const { private: isPrivate } = lastMessage;
return isPrivate;
},
parsedLastMessage() {
const { content_attributes: contentAttributes } = this.lastMessageInChat;
const { email: { subject } = {} } = contentAttributes || {};
@ -230,4 +247,9 @@ export default {
font-size: var(--font-size-mini);
}
}
.last-message-icon {
color: var(--s-600);
font-size: var(--font-size-mini);
}
</style>