Skip to content

feat: add responsive image srcset on CreditLines campaign hero (Closes #848) - #906

Closed
waterWang wants to merge 1 commit into
Creditra:mainfrom
waterWang:feat/responsive-image-srcset-creditlines-848
Closed

waterWang wants to merge 1 commit into
Creditra:mainfrom
waterWang:feat/responsive-image-srcset-creditlines-848

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds a responsive campaign hero image to the CreditLines page with proper srcSet and sizes attributes, so mobile devices download only the image resolution they need instead of desktop-sized assets.

Closes #848

Changes

src/pages/CreditLines.tsx

  • Added a hero banner image section with srcSet containing 3 width candidates (480w, 768w, 1200w)
  • Configured sizes attribute for responsive breakpoint-aware image selection
  • Accessible alt text and role="img" container

src/pages/CreditLines.css

  • Added .cl-hero-image container styles (border-radius, overflow, background)
  • Added .cl-hero-img responsive image styles (100% width, auto height, max-height 240px)

src/pages/__tests__/CreditLines.responsive.test.tsx

  • 4 new tests covering:
    • Renders campaign hero image with accessible alt text
    • Includes srcset attribute with 480w, 768w, 1200w candidates
    • Configures sizes attribute with 100vw and 60vw breakpoints
    • Provides default fallback src attribute

Acceptance Criteria

  • Implement per the description above — srcset for images on CreditLines
  • Add focused tests for the change
  • Document any visible changes
  • Responsive across all breakpoints
  • WCAG 2.1 AA accessibility (alt text, role="img", aria-label)
  • Design-token + dark-mode consistency
  • Clear documentation and inline comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add responsive image srcset on CreditLines [b#035]

2 participants