Improve scrolling behavior in video category rows
Removes console logs from the CategoryRow component in netflix-grid.tsx and simplifies the translateX update logic within the scroll function. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/KcsXLXG
This commit is contained in:
parent
5877e65e60
commit
71ca86f99e
@ -146,10 +146,7 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
const scroll = (direction: 'left' | 'right') => {
|
const scroll = (direction: 'left' | 'right') => {
|
||||||
// Only move one step when clicked (no speed change here)
|
// Only move one step when clicked (no speed change here)
|
||||||
const step = direction === 'right' ? -videoWidth : videoWidth;
|
const step = direction === 'right' ? -videoWidth : videoWidth;
|
||||||
setTranslateX(prev => {
|
setTranslateX(prev => prev + step);
|
||||||
console.log(`Scroll ${direction}: ${prev} + ${step} = ${prev + step}`);
|
|
||||||
return prev + step;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleSpeed = (direction: 'left' | 'right') => {
|
const toggleSpeed = (direction: 'left' | 'right') => {
|
||||||
@ -229,7 +226,6 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
console.log('LEFT BUTTON CLICKED!');
|
|
||||||
scroll('left');
|
scroll('left');
|
||||||
}}
|
}}
|
||||||
onMouseEnter={(e) => {
|
onMouseEnter={(e) => {
|
||||||
@ -251,7 +247,6 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
console.log('RIGHT BUTTON CLICKED!');
|
|
||||||
scroll('right');
|
scroll('right');
|
||||||
}}
|
}}
|
||||||
onMouseEnter={(e) => {
|
onMouseEnter={(e) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user