Skip to content

Conversation

@leandrowd
Copy link
Owner

This commit extracts the arrow and indicator rendering logic from the main Carousel component into dedicated Arrow and Indicator components.

  • I created src/components/Carousel/Arrow.tsx for arrow controls.
  • I created src/components/Carousel/Indicator.tsx for indicator dots.
  • I updated src/components/Carousel/index.tsx to use these new components by modifying defaultProps for renderArrowPrev, renderArrowNext, and renderIndicator.

This change improves code modularity, readability, and reusability of the arrow and indicator UI elements.

All existing tests pass, and snapshots have been updated accordingly.

This commit extracts the arrow and indicator rendering logic from the main Carousel component into dedicated `Arrow` and `Indicator` components.

- I created `src/components/Carousel/Arrow.tsx` for arrow controls.
- I created `src/components/Carousel/Indicator.tsx` for indicator dots.
- I updated `src/components/Carousel/index.tsx` to use these new components by modifying `defaultProps` for `renderArrowPrev`, `renderArrowNext`, and `renderIndicator`.

This change improves code modularity, readability, and reusability of the arrow and indicator UI elements.

All existing tests pass, and snapshots have been updated accordingly.
package.json Outdated
"changelog": "auto-changelog --ignore-commit-pattern=\"(Merge pull request|Merge branch|Updating changelog|Prepare for publishing)\" --breaking-pattern \"BREAKING CHANGE:\"",
"update-codesandbox": "cd codesandbox/default && yarn add react-responsive-carousel@latest",
"format": "prettier \"**/*.{js,ts,tsx,json}\"",
"format": "prettier --write \"**/*.{js,ts,tsx,json}\"",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please undo this change, we have format:write below for this

This commit extracts the arrow and indicator rendering logic from the main Carousel component into dedicated `Arrow` and `Indicator` components.

- I created `src/components/Carousel/Arrow.tsx` for arrow controls.
- I created `src/components/Carousel/Indicator.tsx` for indicator dots.
- I updated `src/components/Carousel/index.tsx` to use these new components by modifying `defaultProps` for `renderArrowPrev`, `renderArrowNext`, and `renderIndicator`.
- I reverted an unintentional modification to the `scripts.format` in `package.json` back to its original state.

This change improves code modularity, readability, and reusability of the arrow and indicator UI elements.

All existing tests pass, and snapshots have been updated accordingly.
@leandrowd leandrowd merged commit dd345eb into master May 26, 2025
2 of 3 checks passed
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