-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Responsive carousel component #1045
Conversation
9c37327
to
bc03a14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Here are some points that I found out while testing it... Worth mentioning that I haven't reviewed the code just yet
- we should add a default value for qtyOfSlidesPerSet so it won't break the app when it's undefined
qtyOfSlidesPerSet
won't work with a number, it only works with an array. When we pass a number, it always renders 2 slides per set
qtyOfSlidesPerSet
doesn't seem to be working with an array set as well.. It seems like it always get the second item from the array and use it disregarding the screen size- We should be able to customize some slide props like border-radius
- The arrow buttons should be
small
by default, right? - Should we be able pass along left/right button on our own? Say we would like to pass a different icon or different button, should we be able to?
- Something is off with the
infiniteLoop
packages/carousel/src/Carousel.js
Outdated
leftButton, | ||
rightButton, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove ambiguity with leftButtonProps
and rightButtonProps
packages/carousel/src/Carousel.js
Outdated
{...leftButton} | ||
icon={leftButton?.icon || <SmChevronLeft size={24} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we pass props after the default props, we don't have to to this condition icon={leftButton?.icon || <SmChevronLeft size={24} />}
packages/carousel/src/Carousel.js
Outdated
infiniteLoop: PropTypes.bool, | ||
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need a prop called style? 🤔
affects: @crave/farmblocks-carousel BREAKING CHANGE: add infinite scroll option; add number of slides displayed; add number of slides displayed by breakpoints; remove imageSet prop; add slides prop that accepts an array of nodes; modify carousel layout; add dots to navigate through slides; add arrows to navigate through slides ISSUES CLOSED: #1043
… components affects: @crave/farmblocks-carousel
…eparate component affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
…window hook affects: @crave/farmblocks-carousel
…e ones affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
affects: @crave/farmblocks-carousel
4da8eb4
to
39c49e4
Compare
We will work on another version of this component soon |
Closes Issues
Code review checklist
Reviewer 1
Reviewer 2