feat: Use Fluent SVG icons on the dashboard (#3482)

This commit is contained in:
Pranav Raj S
2021-11-30 21:03:18 -08:00
committed by GitHub
parent 98be3b33c1
commit c792cfc0be
151 changed files with 613 additions and 617 deletions

View File

@@ -3,32 +3,35 @@ import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
export const getInboxClassByType = (type, phoneNumber) => {
switch (type) {
case INBOX_TYPES.WEB:
return 'ion-earth';
return 'globe-desktop';
case INBOX_TYPES.FB:
return 'ion-social-facebook';
return 'brand-facebook';
case INBOX_TYPES.TWITTER:
return 'ion-social-twitter';
return 'brand-twitter';
case INBOX_TYPES.TWILIO:
return phoneNumber.startsWith('whatsapp')
? 'ion-social-whatsapp-outline'
: 'ion-android-textsms';
? 'brand-whatsapp'
: 'brand-sms';
case INBOX_TYPES.WHATSAPP:
return 'ion-social-whatsapp-outline';
return 'brand-whatsapp';
case INBOX_TYPES.API:
return 'ion-cloud';
return 'cloud';
case INBOX_TYPES.EMAIL:
return 'ion-ios-email';
return 'mail';
case INBOX_TYPES.TELEGRAM:
return 'ion-ios-navigate';
return 'brand-telegram';
case INBOX_TYPES.LINE:
return 'brand-line';
default:
return 'ion-ios-chatbubble';
return 'chat';
}
};

View File

@@ -3,33 +3,35 @@ import { getInboxClassByType } from '../inbox';
describe('#Inbox Helpers', () => {
describe('getInboxClassByType', () => {
it('should return correct class for web widget', () => {
expect(getInboxClassByType('Channel::WebWidget')).toEqual('ion-earth');
expect(getInboxClassByType('Channel::WebWidget')).toEqual(
'globe-desktop'
);
});
it('should return correct class for fb page', () => {
expect(getInboxClassByType('Channel::FacebookPage')).toEqual(
'ion-social-facebook'
'brand-facebook'
);
});
it('should return correct class for twitter profile', () => {
expect(getInboxClassByType('Channel::TwitterProfile')).toEqual(
'ion-social-twitter'
'brand-twitter'
);
});
it('should return correct class for twilio sms', () => {
expect(getInboxClassByType('Channel::TwilioSms', '')).toEqual(
'ion-android-textsms'
'brand-sms'
);
});
it('should return correct class for whatsapp', () => {
expect(getInboxClassByType('Channel::TwilioSms', 'whatsapp')).toEqual(
'ion-social-whatsapp-outline'
'brand-whatsapp'
);
});
it('should return correct class for Api', () => {
expect(getInboxClassByType('Channel::Api')).toEqual('ion-cloud');
expect(getInboxClassByType('Channel::Api')).toEqual('cloud');
});
it('should return correct class for Email', () => {
expect(getInboxClassByType('Channel::Email')).toEqual('ion-ios-email');
expect(getInboxClassByType('Channel::Email')).toEqual('mail');
});
});
});