Skip to content

[ui] Replace <img> tags with Next.js <Image> in contributors and profile pages #97

@AditthyaSS

Description

@AditthyaSS

Several pages use raw tags for user avatars, causing LCP warnings in the build output.
These should be replaced with Next.js for automatic optimisation.

Affected files:

  • src/app/contributors/page.tsx — lines 153, 177, 201, 276
  • src/app/u/[username]/page.tsx — line 266
  • src/components/layout/Navbar.tsx — user avatar img

How to fix:

// Before
<img src={user.avatarUrl} alt={user.name} className="w-8 h-8 rounded-full" />

// After
import Image from "next/image";
<Image src={user.avatarUrl} alt={user.name} width={32} height={32} className="rounded-full" />


next.config.js already has remotePatterns: [{ protocol: 'https', hostname: '**' }] so all external image URLs are already allowed.

Acceptance criteria:

 All <img> tags for user avatars replaced with <Image>
 No new @next/next/no-img-element warnings in the build output
 Avatars still render correctly at all sizes

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions