diff --git a/src/components/genres/Genre.jsx b/src/components/genres/Genre.jsx
index c74424d..dd7c60e 100644
--- a/src/components/genres/Genre.jsx
+++ b/src/components/genres/Genre.jsx
@@ -1,51 +1,82 @@
-import React, { useState } from "react";
+import React, { useRef, useEffect } from "react";
import { Link } from "react-router-dom";
function Genre({ data }) {
- const colors = [
- "#A4B389",
- "#FFBADE",
- "#935C5F",
- "#AD92BC",
- "#ABCCD8",
- "#D8B2AB",
- "#85E1CD",
- "#B7C996",
- ];
+ const scrollContainerRef = useRef(null);
- const [showAll, setShowAll] = useState(false);
- const toggleGenres = () => {
- setShowAll((prev) => !prev);
+ const scroll = (direction) => {
+ if (scrollContainerRef.current) {
+ const scrollAmount = direction === 'left' ? -300 : 300;
+ scrollContainerRef.current.scrollBy({
+ left: scrollAmount,
+ behavior: 'smooth'
+ });
+ }
};
+ // Instant scroll on mount without animation
+ useEffect(() => {
+ if (scrollContainerRef.current) {
+ // Direct manipulation of scrollLeft for instant scroll
+ scrollContainerRef.current.scrollLeft = 300;
+ }
+ }, []);
+
return (
-
-
Genres
-
-
- {data &&
- (showAll ? data : data.slice(0, 24)).map((item, index) => {
- const textColor = colors[index % colors.length];
- return (
-
-
- {item.charAt(0).toUpperCase() + item.slice(1)}
-
-
- );
- })}
-
-
);
diff --git a/src/pages/Home/Home.jsx b/src/pages/Home/Home.jsx
index cdb86ee..0557494 100644
--- a/src/pages/Home/Home.jsx
+++ b/src/pages/Home/Home.jsx
@@ -20,6 +20,9 @@ function Home() {
<>
+
+
+
@@ -70,7 +73,6 @@ function Home() {
/>
-