mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Handle mouse scrolling better
This commit is contained in:
parent
6d93b3105d
commit
366251e143
1 changed files with 4 additions and 7 deletions
|
@ -211,7 +211,6 @@ export function Discover() {
|
|||
}, [movieWidth]);
|
||||
|
||||
let isScrolling = false;
|
||||
|
||||
function handleWheel(e: React.WheelEvent, categorySlug: string) {
|
||||
if (isScrolling) {
|
||||
return;
|
||||
|
@ -262,12 +261,7 @@ export function Discover() {
|
|||
? `${category} Shows`
|
||||
: `${category} Movies`;
|
||||
return (
|
||||
<div
|
||||
className="relative overflow-hidden mt-4 rounded-xl"
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
onWheel={(e) => handleWheel(e, categorySlug)}
|
||||
>
|
||||
<div className="relative overflow-hidden mt-4 rounded-xl">
|
||||
<h2 className="text-2xl font-bold text-white sm:text-3xl md:text-2xl mx-auto pl-2">
|
||||
{displayCategory}
|
||||
</h2>
|
||||
|
@ -281,6 +275,9 @@ export function Discover() {
|
|||
ref={(el) => {
|
||||
carouselRefs.current[categorySlug] = el;
|
||||
}}
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
onWheel={(e) => handleWheel(e, categorySlug)}
|
||||
>
|
||||
{medias.slice(0, 20).map((media) => (
|
||||
<a
|
||||
|
|
Loading…
Reference in a new issue