Skip to content

[Hacktoberfest] Replace img tags with Next.js Image Component for Performance #1411

@BekahHW

Description

@BekahHW

Description

Convert regular <img> tags to Next.js <Image> components throughout the codebase for better performance, automatic optimization, and improved SEO. Next.js Image provides built-in lazy loading, responsive images, and automatic format optimization.

Acceptance Criteria

  • Replace <img> tags in src/app/podcast/page.tsx
  • Replace <img> tags in src/app/podcast/[slug]/page.tsx
  • Replace <img> tags in src/app/events/page.tsx
  • Replace <img> tags in src/app/page.tsx (sponsors section)
  • Replace <img> tags in src/components/MemberCards.tsx
  • Replace <img> tags in src/components/UndrawIllustration.tsx
  • Ensure all images have proper alt text
  • Test that images load correctly and maintain aspect ratios
  • Verify responsive behavior across different screen sizes

Technical Requirements

  • Import Next.js Image component: import Image from 'next/image'
  • Convert width/height attributes to proper Next.js Image props
  • Handle loading="lazy" attribute (Next.js handles this automatically)
  • Convert srcSet to Next.js sizes prop where applicable
  • Ensure alt attributes are preserved
  • Handle any custom styling that may conflict with Next.js Image

Files to Update

  1. src/app/podcast/page.tsx - Podcast episode thumbnails
  2. src/app/podcast/[slug]/page.tsx - Guest headshots and sponsor images
  3. src/app/events/page.tsx - Sponsor images
  4. src/app/page.tsx - Sponsor avatars and supporter images
  5. src/components/MemberCards.tsx - Member avatar images
  6. src/components/UndrawIllustration.tsx - Illustration images

Benefits

  • ✨ Automatic image optimization and format conversion
  • ⚡ Built-in lazy loading for better performance
  • 📱 Responsive images with automatic srcSet generation
  • 🎯 Better Core Web Vitals scores
  • 🚀 Improved SEO through optimized images

Testing Checklist

  • Images display correctly on desktop and mobile
  • No layout shift when images load
  • Alt text is preserved and accessible
  • Loading performance is improved (check Network tab)
  • No console errors related to images

Resources

Difficulty: Beginner-Intermediate

Good for contributors familiar with React who want to learn Next.js optimization patterns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions