Move the entrypoint into kc.gen.tsx
This commit is contained in:
parent
c66236e414
commit
a2d7634fe5
3 changed files with 60 additions and 26 deletions
47
src/kc.gen.tsx
Normal file
47
src/kc.gen.tsx
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* prettier-ignore-start */
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// @ts-nocheck
|
||||
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
|
||||
// This file is auto-generated by Keycloakify
|
||||
|
||||
import { lazy, Suspense, type ReactNode } from "react";
|
||||
|
||||
export type ThemeName = "keycloakify-starter";
|
||||
|
||||
export const themeNames: ThemeName[] = ["keycloakify-starter"];
|
||||
|
||||
export type KcEnvName = never;
|
||||
|
||||
export const kcEnvNames: KcEnvName[] = [];
|
||||
|
||||
export const kcEnvDefaults: Record<KcEnvName, string> = {};
|
||||
|
||||
type KcContext = import("./login/KcContext").KcContext;
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
kcContext?: KcContext;
|
||||
}
|
||||
}
|
||||
|
||||
export const KcLoginPage = lazy(() => import("./login/KcPage"));
|
||||
|
||||
export function KcPage(props: { kcContext: KcContext; fallback?: ReactNode }) {
|
||||
const { kcContext, fallback } = props;
|
||||
return (
|
||||
<Suspense fallback={fallback}>
|
||||
{(() => {
|
||||
switch (kcContext.themeType) {
|
||||
case "login":
|
||||
return <KcLoginPage kcContext={kcContext} />;
|
||||
}
|
||||
})()}
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
/* prettier-ignore-end */
|
||||
Loading…
Add table
Add a link
Reference in a new issue