Implement entrypoint
This commit is contained in:
parent
43c412405a
commit
379f052e6e
25
src/lib/components/KcApp.tsx
Normal file
25
src/lib/components/KcApp.tsx
Normal 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;
|
||||
}
|
||||
|
||||
});
|
@ -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";
|
Loading…
x
Reference in New Issue
Block a user