From 9420dc118a75feb75fe57ee630c822ca20223f6e Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Thu, 6 Jun 2024 06:40:23 +0200 Subject: [PATCH] update --- src/login/KcApp.tsx | 5 +++-- src/main.tsx | 17 ++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/login/KcApp.tsx b/src/login/KcApp.tsx index 3dd158e..a4279b0 100644 --- a/src/login/KcApp.tsx +++ b/src/login/KcApp.tsx @@ -28,8 +28,9 @@ export default function KcApp(props: { kcContext: KcContext }) { } })(); - // The files are in the public directory. - const response = await fetch(`${import.meta.env}terms/${termsFileName}`); + // Dynamically downloading Markdown files from public/terms/[currentLanguage].md + // Replace theses files by your organization's terms of service. + const response = await fetch(`${import.meta.env.BASE_URL}terms/${termsFileName}`); return response.text(); } diff --git a/src/main.tsx b/src/main.tsx index afe1e66..f16b622 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -2,17 +2,19 @@ import { createRoot } from "react-dom/client"; import { StrictMode, lazy, Suspense } from "react"; -const KcLoginThemeApp = lazy(() => import("./login/KcApp")); -const KcAccountThemeApp = lazy(() => import("./account/KcApp")); +// The following block can be uncommented to test a specific page with `yarn dev` +/* +import { getKcContextMock } from "./login/PageStory"; - -// NOTE: This is just to test a specific page when you run `yarn dev` -// however the recommended way to develope is to use the Storybook -if (window.kcContext === undefined) { - window.kcContext = (await import("./login/PageStory")).getKcContextMock({ +if (import.meta.env.DEV) { + window.kcContext = getKcContextMock({ pageId: "register.ftl" }); } +*/ + +const KcLoginThemeApp = lazy(() => import("./login/KcApp")); +const KcAccountThemeApp = lazy(() => import("./account/KcApp")); createRoot(document.getElementById("root")!).render( @@ -30,3 +32,4 @@ createRoot(document.getElementById("root")!).render( ); +