diff --git a/src/Pages/AboutUs/components/projects.jsx b/src/Pages/AboutUs/components/projects.jsx index b035c77..129184f 100644 --- a/src/Pages/AboutUs/components/projects.jsx +++ b/src/Pages/AboutUs/components/projects.jsx @@ -143,7 +143,9 @@ const Projects = (props) => { onClick={() => handleAccordionClick(index)} style={{ height: activeIndex === index ? contentHeight + 40 : 40 }} > -

(paraRef.current[index] = el)}> +

(paraRef.current[index] = el)} + className={clickedIndex === index ? style.whiteText : style.grayText} + > {title[index]}

{ - setInterval(1000, () => { - console.log("Running", goToSlide); - setGoToSlide(goToSlide + (1 % 3)); - }); - }, []); + if (autoPlay) { + const intervalId = setInterval(() => { + setGoToSlide((prevSlide) => (prevSlide + 1) % cards.length); + }, props.interval * 1000); + + return () => clearInterval(intervalId); + } + }, [autoPlay, cards.length, props.interval]); return (
);