Implement entrypoint

This commit is contained in:
Joseph Garrone 2021-03-03 00:04:06 +01:00
parent 43c412405a
commit 379f052e6e
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,25 @@
import { memo } from "react";
import { kcContext } from "../kcContext";
import { assert } from "evt/tools/typeSafety/assert";
import type { KcPagesProperties } from "./KcProperties";
import { Login } from "./Login";
export type KcAppProps = {
kcProperties?: KcPagesProperties;
};
export const KcApp = memo((props: KcAppProps) => {
const { kcProperties } = props;
assert(kcContext !== undefined, "App is not currently served by a Keycloak server");
switch (kcContext.pageBasename) {
case "login.ftl": return <Login kcProperties={kcProperties} />
case "register.ftl":
alert(`TODO: Implement ${kcContext.pageBasename}`);
return null;
}
});

View File

@ -6,4 +6,5 @@ export * from "./i18n/useKcTranslation";
export * from "./components/KcProperties";
export * from "./components/Login";
export * from "./components/Template";
export * from "./components/Template";
export * from "./components/KcApp";