diff --git a/site/source/contexts/DarkModeContext.tsx b/site/source/contexts/DarkModeContext.tsx index 6e485dd69..52ef8902d 100644 --- a/site/source/contexts/DarkModeContext.tsx +++ b/site/source/contexts/DarkModeContext.tsx @@ -14,12 +14,20 @@ export const DarkModeContext = React.createContext({ }) export const DarkModeProvider: React.FC = ({ children }) => { - const [darkMode, setDarkMode] = React.useState( + const [darkMode, _setDarkMode] = React.useState( import.meta.env.DEV && typeof window !== 'undefined' ? (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) : false ) + const setDarkMode = (darkMode: boolean) => { + _setDarkMode(darkMode) + + // https://www.youtube.com/watch?v=Pr8ETbGz35Q + // eslint-disable-next-line no-console + console.log(darkMode ? 'Nuit' : 'Jour') + } + return ( {children}