diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2023-09-27 13:39:39 +0200 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2023-09-29 10:56:54 +0200 |
commit | 15c6bcc281aa0544191af78920233f1e192cd6c1 (patch) | |
tree | c233e0248b5520330e727ce4b4393b91c50ed8f7 | |
parent | ec3ac59f783a9e28404d76036d203f2d1a2eac1a (diff) |
explicitly set the size for ConversationIcon
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r-- | src/components/ConversationIcon.vue | 32 | ||||
-rw-r--r-- | src/components/ConversationSettings/ConversationAvatarEditor.vue | 2 |
2 files changed, 5 insertions, 29 deletions
diff --git a/src/components/ConversationIcon.vue b/src/components/ConversationIcon.vue index 3335d4e1e..72fdd20c2 100644 --- a/src/components/ConversationIcon.vue +++ b/src/components/ConversationIcon.vue @@ -20,8 +20,7 @@ --> <template> - <div ref="conversation-icon" - class="conversation-icon" + <div class="conversation-icon" :style="{'--icon-size': `${size}px`}" :class="{'offline': offline}"> <div v-if="iconClass" @@ -130,22 +129,12 @@ export default { default: false, }, - /** - * Passing in true will make this component fill all the available space in its container. - * This is not reactive as it will take the size of the container once mounted. - */ - isBig: { - type: Boolean, - default: false, + size: { + type: Number, + default: 44, }, }, - data() { - return { - parentElement: undefined, - } - }, - computed: { showCall() { return !this.hideCall && this.item.hasCall @@ -217,14 +206,6 @@ export default { return undefined }, - size() { - if (this.isBig && this.parentElement) { - return Math.min(this.parentElement.clientHeight, this.parentElement.clientWidth) - } else { - return 44 - } - }, - isOneToOne() { return this.item.type === CONVERSATION.TYPE.ONE_TO_ONE }, @@ -242,11 +223,6 @@ export default { }) }, }, - - mounted() { - // Get the size of the parent once the component is mounted - this.parentElement = this.$refs['conversation-icon'].parentElement - }, } </script> diff --git a/src/components/ConversationSettings/ConversationAvatarEditor.vue b/src/components/ConversationSettings/ConversationAvatarEditor.vue index 03e77d22a..1636c3693 100644 --- a/src/components/ConversationSettings/ConversationAvatarEditor.vue +++ b/src/components/ConversationSettings/ConversationAvatarEditor.vue @@ -32,7 +32,7 @@ </div> <ConversationIcon v-else-if="!loading" :item="conversation" - :is-big="true" + :size="180" :show-user-status="false" :disable-menu="true" /> <div v-else class="icon-loading" /> |