aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.tsx')
-rw-r--r--src/main.tsx30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/main.tsx b/src/main.tsx
index 61406d2..2e7e36e 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,6 +1,7 @@
/* eslint-disable react-refresh/only-export-components */
import { createRoot } from "react-dom/client";
-import { StrictMode, lazy, Suspense } from "react";
+import { StrictMode } from "react";
+import { KcPage } from "./kc.gen";
// The following block can be uncommented to test a specific page with `yarn dev`
// Don't forget to comment back or your bundle size will increase
@@ -15,29 +16,12 @@ if (import.meta.env.DEV) {
}
*/
-const KcLoginThemePage = lazy(() => import("./login/KcPage"));
-//const KcAccountThemePage = lazy(() => import("./account/KcPage"));
-
createRoot(document.getElementById("root")!).render(
<StrictMode>
- <Suspense>
- {(() => {
- switch (window.kcContext?.themeType) {
- case "login":
- return <KcLoginThemePage kcContext={window.kcContext} />;
- //case "account":
- // return <KcAccountThemePage kcContext={window.kcContext} />;
- }
- return <h1>No Keycloak Context</h1>;
- })()}
- </Suspense>
+ {!window.kcContext ? (
+ <h1>No Keycloak Context</h1>
+ ) : (
+ <KcPage kcContext={window.kcContext} />
+ )}
</StrictMode>
);
-
-declare global {
- interface Window {
- kcContext?:
- | import("./login/KcContext").KcContext
- //| import("./account/KcContext").KcContext;
- }
-}