mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
EmptyState: Don't apply animation when prefers-reduced-motion is set (#87638)
* don't apply animation when prefers-reduced-motion is set * bail quicker * early return
This commit is contained in:
@@ -24,6 +24,11 @@ export const GrotNotFound = ({ width = 'auto', height }: Props) => {
|
||||
|
||||
useEffect(() => {
|
||||
const handleMouseMove = (event: MouseEvent) => {
|
||||
// don't apply animation if reduced motion preference is set
|
||||
if (window.matchMedia('(prefers-reduced-motion: reduce').matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
const grotArm = svgRef.current?.querySelector('#grot-not-found-arm');
|
||||
const grotMagnifier = svgRef.current?.querySelector('#grot-not-found-magnifier');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user