From ca13664ef93f56e3db8cee2c1ca2da74fefdc3ce Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Thu, 7 Aug 2025 09:50:24 +0530 Subject: [PATCH] chore: Replace Thumbnail with Avatar in conversation card (#12112) --- .../Contacts/ContactsCard/ContactsCard.vue | 1 + .../components-next/avatar/Avatar.vue | 67 +++++++++++------ .../components-next/icon/ChannelIcon.vue | 3 +- .../components-next/icon/provider.js | 14 ++-- .../icon/specs/provider.spec.js | 71 +++++++++++++++++++ .../components/widgets/InboxName.vue | 30 +++----- .../widgets/conversation/ConversationCard.vue | 61 +++++++++------- .../SearchResultConversationItem.vue | 2 +- 8 files changed, 176 insertions(+), 73 deletions(-) diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue b/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue index 0932a79c7..0e893b767 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsCard/ContactsCard.vue @@ -98,6 +98,7 @@ const onClickViewDetails = () => emit('showContact', props.id); :src="thumbnail" :size="48" :status="availabilityStatus" + hide-offline-status rounded-full />
diff --git a/app/javascript/dashboard/components-next/avatar/Avatar.vue b/app/javascript/dashboard/components-next/avatar/Avatar.vue index 65859b1c7..08224995c 100644 --- a/app/javascript/dashboard/components-next/avatar/Avatar.vue +++ b/app/javascript/dashboard/components-next/avatar/Avatar.vue @@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'; import { removeEmoji } from 'shared/helpers/emoji'; import Icon from 'dashboard/components-next/icon/Icon.vue'; +import ChannelIcon from 'dashboard/components-next/icon/ChannelIcon.vue'; import wootConstants from 'dashboard/constants/globals'; const props = defineProps({ @@ -33,10 +34,18 @@ const props = defineProps({ validator: value => !value || wootConstants.AVAILABILITY_STATUS_KEYS.includes(value), }, + inbox: { + type: Object, + default: null, + }, iconName: { type: String, default: null, }, + hideOfflineStatus: { + type: Boolean, + default: false, + }, }); const emit = defineEmits(['upload', 'delete']); @@ -66,11 +75,11 @@ const AVATAR_COLORS = { default: { bg: '#E8E8E8', text: '#60646C' }, }; -const STATUS_CLASSES = { +const STATUS_CLASSES = computed(() => ({ online: 'bg-n-teal-10', busy: 'bg-n-amber-10', - offline: 'bg-n-slate-10', -}; + ...(props.hideOfflineStatus ? {} : { offline: 'bg-n-slate-10' }), +})); const showDefaultAvatar = computed(() => !props.src && !props.name); @@ -178,11 +187,18 @@ watch(
+
+ +
@@ -239,24 +255,33 @@ watch( - + + diff --git a/app/javascript/dashboard/components-next/icon/ChannelIcon.vue b/app/javascript/dashboard/components-next/icon/ChannelIcon.vue index 11117cc18..68102dbd3 100644 --- a/app/javascript/dashboard/components-next/icon/ChannelIcon.vue +++ b/app/javascript/dashboard/components-next/icon/ChannelIcon.vue @@ -1,4 +1,5 @@