mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-10 17:59:17 +00:00
fix toggle
This commit is contained in:
parent
f4d2d4f726
commit
d46f1e4e95
@ -2,10 +2,21 @@
|
||||
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
||||
import { type ThemeProviderProps } from "next-themes/dist/types";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
if (!mounted) {
|
||||
return <div className="bg-black h-screen w-screen" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<NextThemesProvider defaultTheme="dark" enableSystem {...props}>
|
||||
<NextThemesProvider attribute="class" defaultTheme="dark" enableSystem {...props}>
|
||||
{children}
|
||||
</NextThemesProvider>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user