fix: Add background to inbox channel badges (#3152)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Nithin David Thomas 2021-10-06 19:34:34 +05:30 committed by GitHub
parent 219a8c4bc5
commit ec9903ae82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 48 additions and 67 deletions

View file

@ -47,23 +47,29 @@ export default {
const { medium: medium = '' } = this.inbox;
return this.isATwilioChannel && medium === 'whatsapp';
},
chatAdditionalAttributes() {
const { additional_attributes: additionalAttributes } = this.chat || {};
return additionalAttributes || {};
},
isTwitterInboxTweet() {
return (
this.chat &&
this.chat.additional_attributes &&
this.chat.additional_attributes.type === 'tweet'
);
return this.chatAdditionalAttributes.type === 'tweet';
},
twilioBadge() {
return `${this.isATwilioSMSChannel ? 'sms' : 'whatsapp'}`;
},
twitterBadge() {
return `${this.isTwitterInboxTweet ? 'twitter-tweet' : 'twitter-chat'}`;
return `${this.isTwitterInboxTweet ? 'twitter-tweet' : 'twitter-dm'}`;
},
facebookBadge() {
return this.chatAdditionalAttributes.type || 'facebook';
},
inboxBadge() {
if (this.isATwitterInbox) {
return this.twitterBadge;
}
if (this.isAFacebookInbox) {
return this.facebookBadge;
}
if (this.isATwilioChannel) {
return this.twilioBadge;
}