Skip to content

Commit

Permalink
fix: solves display bug of category chevron buttons (#629)
Browse files Browse the repository at this point in the history
* solves display bug of category chevron buttons

* changed: const and filename, removed comments

---------

Co-authored-by: abhiram11 <abhiramsatpute@gmail.com>
Co-authored-by: Sasi <me@sasi.codes>
  • Loading branch information
3 people committed Feb 18, 2023
1 parent 5b09a4d commit a59d129
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions apps/web/src/components/Common/CategoryFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import clsx from 'clsx'
import React, { useEffect, useState } from 'react'
import { Analytics, TRACK } from 'utils'
import { CREATOR_VIDEO_CATEGORIES } from 'utils/data/categories'
import useHorizontalScroll from 'utils/hooks/useHorizantalScroll'
import useHorizontalScroll from 'utils/hooks/useHorizontalScroll'

import ChevronLeftOutline from './Icons/ChevronLeftOutline'
import ChevronRightOutline from './Icons/ChevronRightOutline'
Expand Down Expand Up @@ -38,14 +38,16 @@ const CategoryFilters = () => {

const slide = (shift: number) => {
Analytics.track(TRACK.CLICK_CATEGORIES_SCROLL_BUTTON)

if (scrollRef.current) {
const scrolled = scrollRef.current.scrollLeft + shift
scrollRef.current.scrollLeft += shift
const scrollLeft = scrollRef.current.scrollLeft
setScrollX(scrollLeft === 0 ? 0 : scrollX + shift)

setScrollX(scrolled <= 0 ? 0 : scrollX + shift)

if (
Math.floor(
scrollRef.current.scrollWidth - scrollRef.current.scrollLeft
) <= scrollRef.current.offsetWidth
Math.floor(scrollRef.current.scrollWidth - scrolled) <=
scrollRef.current.offsetWidth
) {
setScrollEnd(true)
} else {
Expand Down
File renamed without changes.

4 comments on commit a59d129

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on a59d129 Feb 18, 2023

Choose a reason for hiding this comment

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

Deployment Status Build Logs Updated At
lenstube ❌ Failed View Logs 2023-02-18T08:33:02.759Z

@vercel
Copy link

@vercel vercel bot commented on a59d129 Feb 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

api – ./

api-git-main-lenstube.vercel.app
api.lenstube.xyz
api-lenstube.vercel.app

@vercel
Copy link

@vercel vercel bot commented on a59d129 Feb 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

embed – ./apps/embed

embed-one.vercel.app
embed-git-main-lenstube.vercel.app
embed-lenstube.vercel.app

@vercel
Copy link

@vercel vercel bot commented on a59d129 Feb 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

web – ./apps/web

web-lenstube.vercel.app
web-git-main-lenstube.vercel.app
web-nine-livid.vercel.app

Please sign in to comment.