Skip to content

Commit c32c819

Browse files
feat(frontend): optimize contributor avatar delivery
1 parent e15a46a commit c32c819

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

components/dashboard/ProfileCard.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ export default function ProfileCard({ user, exportData }: ProfileCardProps) {
2727
<div className="relative mb-5">
2828
<div className="w-24 h-24 rounded-full overflow-hidden border border-black/10 dark:border-[rgba(255,255,255,0.12)]">
2929
{/* eslint-disable-next-line @next/next/no-img-element */}
30-
<img src={user.avatarUrl} alt={user.name} className="w-full h-full object-cover" />
30+
<img
31+
src={`${user.avatarUrl}${user.avatarUrl.includes('?') ? '&' : '?'}s=120`}
32+
alt={user.name || 'Contributor Avatar'}
33+
width={96}
34+
height={96}
35+
loading="lazy"
36+
className="w-full h-full aspect-square object-cover"
37+
/>
3138
</div>
3239
{user.isPro && (
3340
<span className="absolute -bottom-1 -right-1 text-[9px] font-bold bg-black text-white dark:bg-white dark:text-black px-1.5 py-0.5 rounded-full tracking-wide">

0 commit comments

Comments
 (0)