2023-05-23 10:12:19 +02:00
|
|
|
import { BrandingSettings } from "@zitadel/server";
|
2023-04-14 17:22:59 +02:00
|
|
|
import { ZitadelLogo } from "#/ui/ZitadelLogo";
|
|
|
|
|
import React from "react";
|
2023-05-23 10:12:19 +02:00
|
|
|
import { getBrandingSettings, server } from "#/lib/zitadel";
|
|
|
|
|
import { Logo } from "#/ui/Logo";
|
2023-04-03 13:39:51 +02:00
|
|
|
|
|
|
|
|
export default async function Layout({
|
|
|
|
|
children,
|
|
|
|
|
}: {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}) {
|
2023-05-23 10:12:19 +02:00
|
|
|
const branding: BrandingSettings = await getBrandingSettings(server);
|
|
|
|
|
let partial: Partial<BrandingSettings> | undefined;
|
|
|
|
|
if (branding) {
|
|
|
|
|
partial = {
|
|
|
|
|
lightTheme: branding?.lightTheme,
|
|
|
|
|
darkTheme: branding?.darkTheme,
|
|
|
|
|
};
|
|
|
|
|
}
|
2023-04-03 13:39:51 +02:00
|
|
|
return (
|
2023-04-25 09:16:19 +02:00
|
|
|
<div className="mx-auto flex flex-col items-center space-y-4">
|
2023-04-14 17:22:59 +02:00
|
|
|
<div className="relative">
|
2023-05-23 10:12:19 +02:00
|
|
|
<Logo
|
2023-05-23 10:14:31 +02:00
|
|
|
lightSrc={branding.lightTheme?.logoUrl}
|
|
|
|
|
darkSrc={branding.darkTheme?.logoUrl}
|
2023-05-23 10:12:19 +02:00
|
|
|
height={150}
|
|
|
|
|
width={150}
|
|
|
|
|
/>
|
2023-04-03 13:39:51 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="w-full">{children}</div>
|
|
|
|
|
<div className="flex flex-row justify-between"></div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|