Add Info page, refactor

This commit is contained in:
Joseph Garrone
2021-03-06 14:42:56 +01:00
parent f3fb360ce0
commit 25d9d3dc26
13 changed files with 478 additions and 374 deletions

View File

@ -2,23 +2,20 @@
import { memo } from "react";
import { kcContext } from "../kcContext";
import { assert } from "../tools/assert";
import type { KcPagesProperties } from "./KcProperties";
import type { KcProps } from "./KcProps";
import { Login } from "./Login";
import { Register } from "./Register";
import { Info } from "./Info";
export type KcAppProps = {
kcProperties?: KcPagesProperties;
};
export const KcApp = memo((props: KcAppProps) => {
const { kcProperties } = props;
export const KcApp = memo((props: KcProps) => {
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": return <Register kcProperties={kcProperties} />;
case "login.ftl": return <Login {...props} />;
case "register.ftl": return <Register {...props} />;
case "info.ftl": return <Info {...props} />;
}
});