This commit is contained in:
Ubuntu
2026-07-03 16:58:28 +08:00
commit 32b43f85bd
6240 changed files with 1987678 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
"use client";
import { useTheme } from "@/contexts/ThemeContext";
import { useEffect } from "react";
export default function ThemeWrapper({ children }: { children: React.ReactNode }) {
const { colorTheme, variant } = useTheme();
useEffect(() => {
const wrapper = document.querySelector(".theme-wrapper");
if (wrapper) {
wrapper.className = `theme-wrapper theme-${colorTheme} ${variant}`;
}
}, [colorTheme, variant]);
return <div className={`theme-wrapper theme-${colorTheme} ${variant}`}>{children}</div>;
}