feat: compose page + Framer Motion animations + reduced-motion support
This commit is contained in:
1 parent
8947a11e70
commit
e98adf5b08
10 files changed
+65
-19
No files matched your search
@@ -17,3 +17,20 @@ if (typeof window !== 'undefined' && !('IntersectionObserver' in window)) {
|
||||
window.IntersectionObserver = IntersectionObserverStub;
|
||||
global.IntersectionObserver = IntersectionObserverStub;
|
||||
}
|
||||
|
||||
// jsdom lacks matchMedia; usePrefersReducedMotion() calls it in useEffect.
|
||||
// Note: vitest's jsdom environment pre-defines `matchMedia` as an own property
|
||||
// set to `undefined`, so `'matchMedia' in window` is true even though it isn't
|
||||
// a function — guard on typeof instead of `in`.
|
||||
if (typeof window !== 'undefined' && typeof window.matchMedia !== 'function') {
|
||||
window.matchMedia = (query: string) => ({
|
||||
matches: false,
|
||||
media: query,
|
||||
onchange: null,
|
||||
addEventListener: () => {},
|
||||
removeEventListener: () => {},
|
||||
addListener: () => {},
|
||||
removeListener: () => {},
|
||||
dispatchEvent: () => false,
|
||||
}) as unknown as MediaQueryList;
|
||||
}
|
||||
Reference in new issue
Block a user