Skip to content

Conversation

@sylkenio
Copy link

This pull request refactors how responsive image breakpoints are handled for the Image component, improving code organization and maintainability. The main change is moving breakpoint logic out of a shared config file and into a dedicated utility, and updating the component to use this utility. Type definitions are also updated for clarity.

Image component refactor and responsive breakpoints:

  • Removed breakpoints from the shared cssVariables.cjs config file, centralizing breakpoint logic in a new utility.
  • Added a new utility file src/utilities/image-sizes.ts that provides a stringifyBreakpoints function and a standardSizes constant for generating responsive image sizes strings.
  • Updated the Image component (src/components/Media/Image/index.tsx) to use standardSizes from the new utility instead of importing breakpoints from cssVariables.cjs. [1] [2] [3]

Type definition updates:

  • Renamed the image component props interface from Props to MediaProps in src/components/Media/types.ts for consistency and clarity.

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.

1 participant