From 704373994828db3fbf92c9d82811a4dccc857f0a Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Tue, 13 Aug 2024 17:31:06 +0200 Subject: [PATCH 1/3] fix(avatar): decrease avatar size from 44px to 36px Signed-off-by: Maksim Sukharev --- src/components/AvatarWrapper/AvatarWrapper.spec.js | 5 +++-- src/components/LeftSidebar/LeftSidebar.vue | 5 +++-- src/components/TopBar/TopBar.vue | 9 ++++----- src/components/UIShared/LoadingPlaceholder.vue | 6 +++--- src/constants.js | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/components/AvatarWrapper/AvatarWrapper.spec.js b/src/components/AvatarWrapper/AvatarWrapper.spec.js index b7090f25ea4..cf4f6c5702b 100644 --- a/src/components/AvatarWrapper/AvatarWrapper.spec.js +++ b/src/components/AvatarWrapper/AvatarWrapper.spec.js @@ -12,6 +12,7 @@ import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js' import AvatarWrapper from './AvatarWrapper.vue' +import { AVATAR } from '../../constants.js' import storeConfig from '../../store/storeConfig.js' describe('AvatarWrapper.vue', () => { @@ -39,7 +40,7 @@ describe('AvatarWrapper.vue', () => { const avatar = wrapper.findComponent(NcAvatar) expect(avatar.exists()).toBeTruthy() - expect(avatar.props('size')).toBe(44) + expect(avatar.props('size')).toBe(AVATAR.SIZE.DEFAULT) }) test('component does not render NcAvatar for non-users', () => { @@ -89,7 +90,7 @@ describe('AvatarWrapper.vue', () => { expect(avatar.props('showUserStatus')).toBe(true) expect(avatar.props('showUserStatusCompact')).toBe(false) expect(avatar.props('preloadedUserStatus')).toBe(PRELOADED_USER_STATUS) - expect(avatar.props('size')).toBe(44) + expect(avatar.props('size')).toBe(AVATAR.SIZE.DEFAULT) }) }) diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index 99c2a1ac315..940aac2a50d 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -180,7 +180,7 @@ data-nav-id="conversation_create_new" @click="createConversation(searchText)"> @@ -265,11 +265,14 @@ export default { &__type { position: absolute; - right: -4px; - bottom: -4px; - height: 18px; - width: 18px; - border: 2px solid var(--color-main-background); + right: -2px; + bottom: -2px; + display: flex; + align-content: center; + justify-content: center; + height: clamp(14px, 40%, 18px); + width: clamp(14px, 40%, 18px); + border: 1px solid var(--color-main-background); background-color: var(--color-main-background); color: var(--color-main-text); border-radius: 50%; diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index a30c3697eeb..bec6a2a500d 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -1094,5 +1094,15 @@ export default { line-height: 1.2; overflow: hidden; outline-offset: -2px; + + // FIXME clean up after nextcloud/vue release + .avatardiv .avatardiv__user-status { + right: -2px !important; + bottom: -2px !important; + min-height: 14px !important; + min-width: 14px !important; + line-height: 1 !important; + font-size: clamp(var(--font-size-small), 85%, var(--default-font-size)) !important; + } } diff --git a/src/components/RightSidebar/Participants/Participant.vue b/src/components/RightSidebar/Participants/Participant.vue index 10985268108..b998b9ac592 100644 --- a/src/components/RightSidebar/Participants/Participant.vue +++ b/src/components/RightSidebar/Participants/Participant.vue @@ -1147,6 +1147,16 @@ export default { button, button * { cursor: pointer; } + + // FIXME clean up after nextcloud/vue release + .avatardiv .avatardiv__user-status { + right: -2px !important; + bottom: -2px !important; + min-height: 14px !important; + min-width: 14px !important; + line-height: 1 !important; + font-size: clamp(var(--font-size-small), 85%, var(--default-font-size)) !important; + } } &--offline &__user-name {