Skip to content

Commit 0c0c760

Browse files
committed
Display: Adjust avatar styles and set default image URL #5652
1 parent 52bd230 commit 0c0c760

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

assets/css/scss/atoms/_avatar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151

5252
.avatar-list {
53-
@apply flex flex-row flex-wrap gap-4;
53+
@apply flex flex-row flex-wrap gap-2;
5454

5555
.avatar-container {
5656
@apply flex flex-row gap-2;

assets/vue/components/basecomponents/BaseUserAvatar.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<Avatar
33
:aria-label="alt"
4-
:image="`${imageUrl}?w=${imageSize}&h=${imageSize}&fit=crop`"
4+
:image="finalImageUrl"
55
:shape="shape"
66
:size="'normal' !== size ? size : undefined"
77
/>
@@ -37,7 +37,7 @@ const props = defineProps({
3737
})
3838
3939
const imageSize = computed(() => {
40-
// these numbers are approximate, they were calculated with a size
40+
// these numbers are approximate; they were calculated with a size
4141
// allowing to see the image clearly
4242
if (props.size === "xlarge") {
4343
return 112
@@ -49,4 +49,12 @@ const imageSize = computed(() => {
4949
5050
return 32
5151
})
52+
53+
const finalImageUrl = computed(() => {
54+
if (!props.imageUrl) {
55+
return `/img/icons/${imageSize.value}/unknown.png`
56+
}
57+
58+
return `${props.imageUrl}?w=${imageSize.value}&h=${imageSize.value}&fit=crop`
59+
})
5260
</script>

0 commit comments

Comments
 (0)