Skip to content

A self-hosted media server and file management system

fix: user card image does not maintain size when lazy loading

aminnausin2fca13529b81
diff --git a/resources/js/components/cards/data/UserCard.vue b/resources/js/components/cards/data/UserCard.vue
index 11acadae..b51e18a3 100644
--- a/resources/js/components/cards/data/UserCard.vue
+++ b/resources/js/components/cards/data/UserCard.vue
@@ -20,8 +20,8 @@ const props = defineProps<{ data: UserResource }>();
<template>
<div class="xs:flex-row xs:gap-4 xs:p-3 group data-card relative flex w-full flex-col rounded-xl text-left shadow-sm ring-1 ring-gray-900/5">
<LazyImage
- :wrapper-class="'my-auto flex flex-col w-auto sm:aspect-square relative'"
- class="xs:max-h-16 xs:rounded-full my-auto aspect-square h-full max-h-28 rounded-t-xl object-cover"
+ :wrapper-class="'my-auto flex flex-col w-auto xs:aspect-square relative xs:size-16'"
+ class="xs:rounded-full aspect-square h-full max-h-28 rounded-t-xl object-cover"
:src="`https://ui-avatars.com/api/?name=${data.name[0]}&amp;color=7F9CF5&amp;background=random`"
:alt="data.name ?? 'user profile'"
/>
@@ -102,12 +102,12 @@ const props = defineProps<{ data: UserResource }>();
</template>
</div>
</section>
- <section class="text-foreground-1 flex w-full flex-col text-sm sm:flex-row sm:justify-between">
+ <section class="text-foreground-1 mt-auto flex w-full flex-col text-sm sm:flex-row sm:justify-between">
<h3 class="w-full truncate text-wrap sm:text-nowrap" :title="`Date joined`">
Date Joined:
{{ data.created_at ? toFormattedDate(new Date(data.created_at), false, { year: 'numeric', month: 'short', day: 'numeric' }) : 'Unknown' }}
</h3>
- <h3 class="line-clamp-2 w-full truncate capitalize sm:text-right" v-show="data.last_active" title="Last date of activity">
+ <h3 class="line-clamp-2 w-full truncate capitalize sm:text-right" v-if="data.last_active" title="Last date of activity">
Last Active:
{{ data.last_active ? toTimeSpan(new Date(data.last_active)) : 'Unknown' }}
</h3>