keycloak-theme/src/main.tsx

28 lines
762 B
TypeScript
Raw Normal View History

2024-06-06 01:44:57 +02:00
/* eslint-disable react-refresh/only-export-components */
2022-09-06 19:22:23 +02:00
import { createRoot } from "react-dom/client";
2024-07-27 17:11:30 +02:00
import { StrictMode } from "react";
import { KcPage } from "./kc.gen";
2022-09-06 19:22:23 +02:00
2024-06-06 06:40:23 +02:00
// The following block can be uncommented to test a specific page with `yarn dev`
2024-06-06 07:46:48 +02:00
// Don't forget to comment back or your bundle size will increase
2024-06-06 06:40:23 +02:00
/*
2024-06-09 12:33:12 +02:00
import { getKcContextMock } from "./login/KcPageStory";
2022-09-06 19:22:23 +02:00
2024-06-06 06:40:23 +02:00
if (import.meta.env.DEV) {
window.kcContext = getKcContextMock({
2024-06-08 03:34:31 +02:00
pageId: "register.ftl",
overrides: {}
2024-06-06 05:26:06 +02:00
});
}
2024-06-06 06:40:23 +02:00
*/
2022-09-06 19:22:23 +02:00
createRoot(document.getElementById("root")!).render(
<StrictMode>
2024-07-27 17:11:30 +02:00
{!window.kcContext ? (
<h1>No Keycloak Context</h1>
) : (
<KcPage kcContext={window.kcContext} />
)}
2023-02-27 10:13:07 +01:00
</StrictMode>
2022-09-06 19:22:23 +02:00
);