Skip to content
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

Corousel #28

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from
Open

Corousel #28

wants to merge 9 commits into from

Conversation

a-saran
Copy link

@a-saran a-saran commented Apr 22, 2020

No description provided.

@a-saran a-saran added the ready-for-review PR that is ready for review label Apr 22, 2020
@@ -28,6 +28,10 @@ const sidebarLinks = [
name: 'Pill',
ref: '/pill',
},
{
name: 'Corousel',

Choose a reason for hiding this comment

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

Should be Carousel. There are other spelling errors too. You can also use this extension to automatically check for any mistakes that might have accidentally crept in during typing.


const getWidth = () => coroselRef.current.getBoundingClientRect().width;

const nextSlide = () => {

Choose a reason for hiding this comment

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

We can perhaps merge the nextSlide and prevSlide to a single method that takes in the operation type and applies the modulus method of circular iteration over the items. Would reduce the need for if clause and repeated code over the methods. The formula to calculate next index should be (x+(operation)+N)%N where x is the current index, the operation is +1 or -1 and N is the total number of items.

activeIndex: 0,
translate: 0,
transition: 0.45,
});

Choose a reason for hiding this comment

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

Maybe we can take out the transition to a constant since it is never updated?

@rishichawda
Copy link

  1. When auto slide/scroll is enabled, on clicking the arrow indicator - the timer/interval doesn't reset itself on the component, which makes the carousel skip the next slide or scroll twice quickly. Ideally, when clicked, it should clear the already set interval/timeout and start the timer again for the autoplay.
  2. In the documentation, default prop for showArrows is mentioned as primary - but it is a boolean value with true as the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review PR that is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants