24 lines
703 B
TypeScript
Raw Normal View History

2021-03-03 00:04:06 +01:00
import { memo } from "react";
import { kcContext } from "../kcContext";
import { assert } from "evt/tools/typeSafety/assert";
import type { KcPagesProperties } from "./KcProperties";
import { Login } from "./Login";
2021-03-04 18:15:48 +01:00
import { Register } from "./Register";
2021-03-03 00:04:06 +01:00
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) {
2021-03-04 18:15:48 +01:00
case "login.ftl": return <Login kcProperties={kcProperties} />;
case "register.ftl": return <Register kcProperties={kcProperties} />;
2021-03-03 00:04:06 +01:00
}
});