mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 07:24:51 +00:00
management labelpolicy
This commit is contained in:
@@ -1,15 +1,34 @@
|
||||
"use client";
|
||||
|
||||
import { getBranding } from "#/lib/zitadel";
|
||||
import { useTheme } from "next-themes";
|
||||
import { server } from "../lib/zitadel";
|
||||
|
||||
const ThemeWrapper = ({ children }: any) => {
|
||||
const ThemeWrapper = async ({ children }: any) => {
|
||||
const { resolvedTheme } = useTheme();
|
||||
|
||||
const isDark = resolvedTheme && resolvedTheme === "dark";
|
||||
|
||||
return (
|
||||
<div className={`${isDark ? "ui-dark" : "ui-light"} `}>{children}</div>
|
||||
);
|
||||
try {
|
||||
const policy = await getBranding(server);
|
||||
|
||||
const backgroundStyle = {
|
||||
backgroundColor: `${policy?.backgroundColorDark}.`,
|
||||
};
|
||||
|
||||
console.log(policy);
|
||||
|
||||
return (
|
||||
<div className={`${isDark ? "ui-dark" : "ui-light"} `}>
|
||||
<div style={backgroundStyle}>{children}</div>
|
||||
</div>
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
return (
|
||||
<div className={`${isDark ? "ui-dark" : "ui-light"} `}>{children}</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default ThemeWrapper;
|
||||
|
||||
Reference in New Issue
Block a user