From 34868a41534398df204df77f5fa70174c4727a6e Mon Sep 17 00:00:00 2001 From: garronej Date: Mon, 27 Feb 2023 10:13:07 +0100 Subject: [PATCH] Small refactor --- README.md | 6 +++--- src/index.tsx | 13 +++++++++---- src/{keycloakTheme => keycloak-theme}/KcApp.css | 0 src/{keycloakTheme => keycloak-theme}/KcApp.tsx | 0 src/{keycloakTheme => keycloak-theme}/Template.tsx | 0 .../assets/background.svg | 0 .../assets/tos_en.md | 0 .../assets/tos_fr.md | 0 src/{keycloakTheme => keycloak-theme}/i18n.ts | 0 src/{keycloakTheme => keycloak-theme}/kcContext.ts | 0 .../pages/Login.tsx | 0 .../pages/MyExtraPage1.tsx | 0 .../pages/MyExtraPage2.tsx | 0 .../pages/Register.tsx | 0 .../pages/Terms.tsx | 0 15 files changed, 12 insertions(+), 7 deletions(-) rename src/{keycloakTheme => keycloak-theme}/KcApp.css (100%) rename src/{keycloakTheme => keycloak-theme}/KcApp.tsx (100%) rename src/{keycloakTheme => keycloak-theme}/Template.tsx (100%) rename src/{keycloakTheme => keycloak-theme}/assets/background.svg (100%) rename src/{keycloakTheme => keycloak-theme}/assets/tos_en.md (100%) rename src/{keycloakTheme => keycloak-theme}/assets/tos_fr.md (100%) rename src/{keycloakTheme => keycloak-theme}/i18n.ts (100%) rename src/{keycloakTheme => keycloak-theme}/kcContext.ts (100%) rename src/{keycloakTheme => keycloak-theme}/pages/Login.tsx (100%) rename src/{keycloakTheme => keycloak-theme}/pages/MyExtraPage1.tsx (100%) rename src/{keycloakTheme => keycloak-theme}/pages/MyExtraPage2.tsx (100%) rename src/{keycloakTheme => keycloak-theme}/pages/Register.tsx (100%) rename src/{keycloakTheme => keycloak-theme}/pages/Terms.tsx (100%) diff --git a/README.md b/README.md index 9d3a38b..898ccaf 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ yarn 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) 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. # Think your theme is ready? Run @@ -85,8 +85,8 @@ and remove unnecessary file. ```bash rm -r src/App -mv src/keycloakTheme/* src/ -rm -r src/keycloakTheme +mv src/keycloak-theme/* src/ +rm -r src/keycloak-theme cat << EOF > src/index.tsx import { createRoot } from "react-dom/client"; diff --git a/src/index.tsx b/src/index.tsx index d671dba..37d6a5e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,12 +1,17 @@ import { createRoot } from "react-dom/client"; import { StrictMode, lazy, Suspense } from "react"; -import { kcContext } from "./keycloakTheme/kcContext"; +import { kcContext } from "./keycloak-theme/kcContext"; const App = lazy(() => import("./App")); -const KcApp = lazy(() => import("./keycloakTheme/KcApp")); +const KcApp = lazy(() => import("./keycloak-theme/KcApp")); createRoot(document.getElementById("root")!).render( - {kcContext === undefined ? : } - , + + {kcContext === undefined ? + : + + } + + ); diff --git a/src/keycloakTheme/KcApp.css b/src/keycloak-theme/KcApp.css similarity index 100% rename from src/keycloakTheme/KcApp.css rename to src/keycloak-theme/KcApp.css diff --git a/src/keycloakTheme/KcApp.tsx b/src/keycloak-theme/KcApp.tsx similarity index 100% rename from src/keycloakTheme/KcApp.tsx rename to src/keycloak-theme/KcApp.tsx diff --git a/src/keycloakTheme/Template.tsx b/src/keycloak-theme/Template.tsx similarity index 100% rename from src/keycloakTheme/Template.tsx rename to src/keycloak-theme/Template.tsx diff --git a/src/keycloakTheme/assets/background.svg b/src/keycloak-theme/assets/background.svg similarity index 100% rename from src/keycloakTheme/assets/background.svg rename to src/keycloak-theme/assets/background.svg diff --git a/src/keycloakTheme/assets/tos_en.md b/src/keycloak-theme/assets/tos_en.md similarity index 100% rename from src/keycloakTheme/assets/tos_en.md rename to src/keycloak-theme/assets/tos_en.md diff --git a/src/keycloakTheme/assets/tos_fr.md b/src/keycloak-theme/assets/tos_fr.md similarity index 100% rename from src/keycloakTheme/assets/tos_fr.md rename to src/keycloak-theme/assets/tos_fr.md diff --git a/src/keycloakTheme/i18n.ts b/src/keycloak-theme/i18n.ts similarity index 100% rename from src/keycloakTheme/i18n.ts rename to src/keycloak-theme/i18n.ts diff --git a/src/keycloakTheme/kcContext.ts b/src/keycloak-theme/kcContext.ts similarity index 100% rename from src/keycloakTheme/kcContext.ts rename to src/keycloak-theme/kcContext.ts diff --git a/src/keycloakTheme/pages/Login.tsx b/src/keycloak-theme/pages/Login.tsx similarity index 100% rename from src/keycloakTheme/pages/Login.tsx rename to src/keycloak-theme/pages/Login.tsx diff --git a/src/keycloakTheme/pages/MyExtraPage1.tsx b/src/keycloak-theme/pages/MyExtraPage1.tsx similarity index 100% rename from src/keycloakTheme/pages/MyExtraPage1.tsx rename to src/keycloak-theme/pages/MyExtraPage1.tsx diff --git a/src/keycloakTheme/pages/MyExtraPage2.tsx b/src/keycloak-theme/pages/MyExtraPage2.tsx similarity index 100% rename from src/keycloakTheme/pages/MyExtraPage2.tsx rename to src/keycloak-theme/pages/MyExtraPage2.tsx diff --git a/src/keycloakTheme/pages/Register.tsx b/src/keycloak-theme/pages/Register.tsx similarity index 100% rename from src/keycloakTheme/pages/Register.tsx rename to src/keycloak-theme/pages/Register.tsx diff --git a/src/keycloakTheme/pages/Terms.tsx b/src/keycloak-theme/pages/Terms.tsx similarity index 100% rename from src/keycloakTheme/pages/Terms.tsx rename to src/keycloak-theme/pages/Terms.tsx