diff --git a/components/system/components/GlobalCarousel/index.js b/components/system/components/GlobalCarousel/index.js index f7e5073a..69528b6b 100644 --- a/components/system/components/GlobalCarousel/index.js +++ b/components/system/components/GlobalCarousel/index.js @@ -88,7 +88,12 @@ function CarouselHeader({ current, total, onAction, + onClose, + enableNextSlide, + enablePreviousSlide, + onNextSlide, + onPreviousSlide, ...props }) { const [isHeaderVisible, setHeaderVisibility] = React.useState(true); @@ -176,10 +181,22 @@ function CarouselHeader({ /> + + { - clearTimeout(timeoutRef.current); - setControlsVisibility(true); - }; - - const hideControls = () => { - timeoutRef.current = setTimeout(() => { - setControlsVisibility(false); - }, 500); - }; - - React.useEffect(() => { - timeoutRef.current = setTimeout(hideControls, 3000); - return () => clearTimeout(timeoutRef.current); - }, []); - return ( <>
{enablePreviousSlide ? ( @@ -539,16 +540,15 @@ function CarouselControls({ ) : null}
{enableNextSlide ? ( @@ -783,16 +783,6 @@ export function GlobalCarousel({ return (
- {!isMobile ? ( - 0} - onNextSlide={handleNext} - onPreviousSlide={handlePrevious} - onClose={handleClose} - /> - ) : null} - {isMobile ? ( 0} + onNextSlide={handleNext} + onPreviousSlide={handlePrevious} onClose={handleClose} /> )}