We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f59736 commit 89b7ec3Copy full SHA for 89b7ec3
src/components/layout.js
@@ -5,16 +5,18 @@ import Snowfall from 'react-snowfall';
5
import Header from 'components/header';
6
import useDarkMode from 'hooks/useDarkMode';
7
import { getDate, getMonth } from 'date-fns';
8
+import usePrefersReducedMotion from 'src/hooks/usePrefersReducedMotion';
9
10
export default function Layout({ children }) {
11
useDarkMode();
12
13
+ const disableMotion = usePrefersReducedMotion();
14
const isChristmas =
15
getMonth(Date.now()) === 11 && [24, 25, 26].includes(getDate(Date.now()));
16
17
return (
18
<Fragment>
- {isChristmas && <Snowfall />}
19
+ {!disableMotion && isChristmas && <Snowfall />}
20
<Header />
21
<main className="mt-3 mb-2">{children}</main>
22
</Fragment>
0 commit comments