Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Updates icons to show last message type #2743

Merged
merged 1 commit into from Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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 {
Expand Down
Expand Up @@ -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>
Expand Down Expand Up @@ -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 || {};
Expand Down Expand Up @@ -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>