Skip to content

Commit 4e8d293

Browse files
committed
perf(frontend): add lazy loading to profile and wallet images
Set loading=lazy on Avatar and wallet icon img elements to defer offscreen image requests until users scroll them into view.
1 parent 6bdbccf commit 4e8d293

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/src/components/Avatar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const Avatar: React.FC<AvatarProps> = ({
4949
<img
5050
src={avatarUrl}
5151
alt={name}
52+
loading="lazy"
5253
className="w-full h-full object-cover"
5354
onError={() => {
5455
setHasImageError(true);

frontend/src/providers/WalletProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export const WalletProvider: React.FC<{ children: React.ReactNode }> = ({ childr
206206
>
207207
<div className="flex items-center gap-3">
208208
{wallet.icon ? (
209-
<img src={wallet.icon} alt={wallet.name} className="h-6 w-6 rounded" />
209+
<img src={wallet.icon} alt={wallet.name} loading="lazy" className="h-6 w-6 rounded" />
210210
) : (
211211
<div className="h-6 w-6 rounded bg-white/10" />
212212
)}

0 commit comments

Comments
 (0)