Update README.md & fix test
Build and Push Next App / quality (push) Successful in 1m40s
Build and Push Next App / build-next (push) Successful in 4m17s

This commit is contained in:
Gabriel Brown
2026-06-22 10:42:47 -04:00
parent 206b64176b
commit ddce5efb13
3 changed files with 107 additions and 89 deletions
@@ -61,10 +61,27 @@ const steps: DemoStepConfig[] = [
},
];
const getReducedMotionPreference = () => {
if (
typeof window === 'undefined' ||
typeof window.matchMedia !== 'function'
) {
return false;
}
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
};
const usePrefersReducedMotion = () => {
const [reducedMotion, setReducedMotion] = useState(true);
const [reducedMotion, setReducedMotion] = useState(
getReducedMotionPreference,
);
useEffect(() => {
if (typeof window.matchMedia !== 'function') {
return;
}
const query = window.matchMedia('(prefers-reduced-motion: reduce)');
const update = () => setReducedMotion(query.matches);
update();