2022-10-31 23:46:17 +08:00
|
|
|
/*
|
2024-09-06 16:22:13 +08:00
|
|
|
Copyright 2022-2024 New Vector Ltd.
|
2022-10-31 23:46:17 +08:00
|
|
|
|
2024-09-06 16:22:13 +08:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
Please see LICENSE in the repository root for full details.
|
2022-10-31 23:46:17 +08:00
|
|
|
*/
|
|
|
|
|
2023-09-09 03:39:10 +08:00
|
|
|
import { useMediaQuery } from "./useMediaQuery";
|
2022-10-31 23:46:17 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns Whether the user has requested reduced motion.
|
|
|
|
*/
|
2023-09-23 06:05:13 +08:00
|
|
|
export const usePrefersReducedMotion = (): boolean =>
|
2023-09-09 03:39:10 +08:00
|
|
|
useMediaQuery("(prefers-reduced-motion)");
|