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

chore(website): make caurosel horizontally scrollable (closes #562) #639

Open
wants to merge 1,216 commits into
base: main
Choose a base branch
from

Conversation

intldds
Copy link

@intldds intldds commented Feb 18, 2024

chore(website): make caurosel horizontally scrollable (closes #562)

Added horizontal scrolling on the "Carousel.tsx" file

Description

Added horizontal scrolling on the "Carousel.tsx" file Feature (website) Carousel isn't scrolling horizontally (issue #562) Carousel should be scrolling horizontally now No

Related Issue(s)

#562

Other information

I've basically just added one line in the Project Card box:

overflowX="auto"

and it should work smoothly : )

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have run yarn prettier and yarn lint without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

cedoor and others added 30 commits November 6, 2023 22:18
…t/carousel-animation

Carousel animations
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
…actor/responsive-footer

Responsive footer
…re/pse-icon

Add PSE icon to the button in the "Projects" page
…/website-metadata

Change website metadata
…/website-metadata-img

Update website metadata image
…f/background-images

NextJS background images
cedoor and others added 23 commits January 31, 2024 14:16
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
Co-authored-by: Vivian Plasencia <v.pcalana@gmail.com>
@@ -71,6 +71,7 @@ export default function Carousel({ title, sizes, type, ...props }: CarouselProps
<HStack w="full" overflow="hidden">
<HStack
w="full"
overflowX="auto" // Enable horizontal scrolling
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the arrows buttons don't work properly after scrolling. I'm testing it with my laptop. Could you try it?

Copy link
Author

Choose a reason for hiding this comment

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

You are right -- I forgot to test the arrows buttons and they were not working.

I've added a new commit that should fix this :) (at least on my laptop in several browsers, both the arrows and the scrolling should be working now)

Copy link
Member

Choose a reason for hiding this comment

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

Hey @intldds, they are working now. But when I scroll and then use the arrows the scrollbar changes its size and cannot be used to reach all the items anymore. Can you see it?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @cedoor, the Right Arrow seems to be working fine with the desired behavior. However, the Left Arrow indeed is not working as supposed to. I would guess the problem is probably in the previousProject const, which is somehow being overridden by the scrolling functionality.

I've tried making some changes but unfortunately couldn't make it work. It's a bit weird because the Right Arrow recognizes the index of the project and works fine, but when clicking on the Left Arrow it always assumes the index is 0 and takes me back to the last project.

Both previousProject and nextProject are built in similar way, so I can't figure out why the scrollbar only causes this error on the left side.

@vplasencia
Copy link
Member

Hey @intldds! Thank you so much for all the work. What about using onScroll={() => resetIndex() here: https://github.com/semaphore-protocol/semaphore/pull/639/files#diff-ce27813f8a675d2fb0dab237071308614cd061c42bf95d38401bfe01ef405438R71

We could have control every time the element is scrolled. Then we can set the value in a way that if it was scrolled and someone click on one of the arrows, the list will start from the beginning.

Then, if someone wants to scroll, they can do it and if they want to click on the arrows they can do it too.

What do you think?

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.

Make caurosels horizontally scrollable in the website
8 participants