From 694fdb2a3c08f8aeea5223f8368d94b149cd4a31 Mon Sep 17 00:00:00 2001 From: "Malin J." Date: Tue, 24 Sep 2024 13:15:49 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20unused=20hook=20#2475?= =?UTF-8?q?=20(#2518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hooks/usePrefersReducedMotion.ts | 20 ------------------- web/core/Carousel/CarouselVideoItem.tsx | 1 - 2 files changed, 21 deletions(-) delete mode 100644 web/components/src/Accordion/hooks/usePrefersReducedMotion.ts diff --git a/web/components/src/Accordion/hooks/usePrefersReducedMotion.ts b/web/components/src/Accordion/hooks/usePrefersReducedMotion.ts deleted file mode 100644 index 5c4262225..000000000 --- a/web/components/src/Accordion/hooks/usePrefersReducedMotion.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { useState, useEffect } from 'react' - -const QUERY = '(prefers-reduced-motion: no-preference)' - -const isRenderingOnServer = typeof window === 'undefined' - -const getInitialState = () => { - return isRenderingOnServer ? true : !window.matchMedia(QUERY).matches -} - -export const usePrefersReducedMotion = () => { - const [prefersReducedMotion, setPrefersReducedMotion] = useState(getInitialState) - - useEffect(() => { - const mediaQueryList = window.matchMedia(QUERY) - - setPrefersReducedMotion(!mediaQueryList.matches) - }, []) - return prefersReducedMotion -} diff --git a/web/core/Carousel/CarouselVideoItem.tsx b/web/core/Carousel/CarouselVideoItem.tsx index 41017138e..7739f7a49 100644 --- a/web/core/Carousel/CarouselVideoItem.tsx +++ b/web/core/Carousel/CarouselVideoItem.tsx @@ -3,7 +3,6 @@ import { VideoPlayerCarouselItem, VideoPlayerRatios } from '../../types/types' import { DisplayModes } from './Carousel' import { VideoComponentWithCaption } from '../../pageComponents/shared/VideoPlayer' import { forwardRef, HTMLAttributes } from 'react' -//import { usePrefersReducedMotion } from '../../common/hooks/usePrefersReducedMotion' type CarouselVideoItemProps = { displayMode?: DisplayModes