iipbs_cs #11

Merged
chanii8 merged 11 commits from iipbs_cs into main 2025-03-21 11:32:12 +09:00
2 changed files with 6 additions and 3 deletions
Showing only changes of commit 699eadb399 - Show all commits
+5 -2
View File
@@ -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;