mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(website): migration from old website
This commit is contained in:
13
apps/website/src/hooks/useSystemThemeFallback.ts
Normal file
13
apps/website/src/hooks/useSystemThemeFallback.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export function useSystemThemeFallback() {
|
||||
useEffect(() => {
|
||||
const theme = localStorage.getItem('theme');
|
||||
if (theme === 'auto') {
|
||||
localStorage.setItem('theme', 'system');
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
}
|
||||
Reference in New Issue
Block a user