Small refactor
This commit is contained in:
parent
7b231748a2
commit
34868a4153
@ -14,7 +14,7 @@ yarn
|
|||||||
yarn build-keycloak-theme # Build the theme one time (some assets will be copied to
|
yarn build-keycloak-theme # Build the theme one time (some assets will be copied to
|
||||||
# public/keycloak_static, they are needed to dev your page outside of Keycloak)
|
# public/keycloak_static, they are needed to dev your page outside of Keycloak)
|
||||||
yarn start # See the Hello World app
|
yarn start # See the Hello World app
|
||||||
# Uncomment line 15 of src/keycloakTheme/kcContext, reload https://localhost:3000
|
# Uncomment line 15 of src/keycloak-theme/kcContext, reload https://localhost:3000
|
||||||
# You can now develop your Login pages.
|
# You can now develop your Login pages.
|
||||||
|
|
||||||
# Think your theme is ready? Run
|
# Think your theme is ready? Run
|
||||||
@ -85,8 +85,8 @@ and remove unnecessary file.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
rm -r src/App
|
rm -r src/App
|
||||||
mv src/keycloakTheme/* src/
|
mv src/keycloak-theme/* src/
|
||||||
rm -r src/keycloakTheme
|
rm -r src/keycloak-theme
|
||||||
|
|
||||||
cat << EOF > src/index.tsx
|
cat << EOF > src/index.tsx
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import { StrictMode, lazy, Suspense } from "react";
|
import { StrictMode, lazy, Suspense } from "react";
|
||||||
import { kcContext } from "./keycloakTheme/kcContext";
|
import { kcContext } from "./keycloak-theme/kcContext";
|
||||||
|
|
||||||
const App = lazy(() => import("./App"));
|
const App = lazy(() => import("./App"));
|
||||||
const KcApp = lazy(() => import("./keycloakTheme/KcApp"));
|
const KcApp = lazy(() => import("./keycloak-theme/KcApp"));
|
||||||
|
|
||||||
createRoot(document.getElementById("root")!).render(
|
createRoot(document.getElementById("root")!).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<Suspense>{kcContext === undefined ? <App /> : <KcApp kcContext={kcContext} />}</Suspense>
|
<Suspense>
|
||||||
</StrictMode>,
|
{kcContext === undefined ?
|
||||||
|
<App /> :
|
||||||
|
<KcApp kcContext={kcContext} />
|
||||||
|
}
|
||||||
|
</Suspense>
|
||||||
|
</StrictMode>
|
||||||
);
|
);
|
||||||
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
Loading…
Reference in New Issue
Block a user