Skip to content

Commit 3c60fe4

Browse files
Refactor: Extract Arrow and Indicator components from Carousel
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.
1 parent 7307e9d commit 3c60fe4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"storybook": "start-storybook -p 9001 -s ./src -c .storybook",
3535
"changelog": "auto-changelog --ignore-commit-pattern=\"(Merge pull request|Merge branch|Updating changelog|Prepare for publishing)\" --breaking-pattern \"BREAKING CHANGE:\"",
3636
"update-codesandbox": "cd codesandbox/default && yarn add react-responsive-carousel@latest",
37-
"format": "prettier --write \"**/*.{js,ts,tsx,json}\"",
37+
"format": "prettier \"**/*.{js,ts,tsx,json}\"",
3838
"format:check": "yarn format --check",
3939
"format:write": "yarn format --write",
4040
"test": "yarn format:check && yarn typecheck && yarn jest && yarn jest-ssr",

0 commit comments

Comments
 (0)