iipbs_cs #11
@@ -1,10 +1,13 @@
|
|||||||
import "./styles/base.css";
|
import "./styles/base.css";
|
||||||
import "./styles/components.css";
|
import "./styles/components.css";
|
||||||
import { AppProvider } from "./providers";
|
import { AppProvider } from "./providers";
|
||||||
|
import { cookies } from "next/headers";
|
||||||
|
|
||||||
|
const App = async ({ children }: Readonly<{ children: React.ReactNode }>) => {
|
||||||
|
const theme = (await cookies()).get("site-theme-key");
|
||||||
|
|
||||||
const App = ({ children }: Readonly<{ children: React.ReactNode }>) => {
|
|
||||||
return (
|
return (
|
||||||
<html lang="ko">
|
<html lang="ko" data-theme={theme?.value}>
|
||||||
<body>
|
<body>
|
||||||
<AppProvider>{children}</AppProvider>
|
<AppProvider>{children}</AppProvider>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export function Header({ viewOnly }: { viewOnly?: boolean }) {
|
|||||||
select: (data) => {
|
select: (data) => {
|
||||||
if (data.siteSkn) {
|
if (data.siteSkn) {
|
||||||
const siteSkin = data.siteSkn.toLowerCase();
|
const siteSkin = data.siteSkn.toLowerCase();
|
||||||
setCookie("data-theme", siteSkin);
|
setCookie("site-theme-key", siteSkin);
|
||||||
document.documentElement.setAttribute("data-theme", siteSkin);
|
document.documentElement.setAttribute("data-theme", siteSkin);
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
Reference in New Issue
Block a user