update
This commit is contained in:
parent
2b4c85aa7e
commit
05d1a1f8ea
44
README.md
44
README.md
@ -49,13 +49,6 @@ To release a new version **just update the `package.json` version and push**.
|
|||||||
To enable the workflow go to your fork of this repository on GitHub then navigate to:
|
To enable the workflow go to your fork of this repository on GitHub then navigate to:
|
||||||
`Settings` > `Actions` > `Workflow permissions`, select `Read and write permissions`.
|
`Settings` > `Actions` > `Workflow permissions`, select `Read and write permissions`.
|
||||||
|
|
||||||
# Removing the account theme
|
|
||||||
|
|
||||||
If you don't need to customize [the account theme pages](https://storybook.keycloakify.dev/?path=/story/account-account--default).
|
|
||||||
You can remove the `src/account` directory.
|
|
||||||
This will significantly reduce the the size of the jar and the build time.
|
|
||||||
Don't forget to update `src/main.tsx` and `src/vite-env.d.ts`.
|
|
||||||
|
|
||||||
# Email theme
|
# Email theme
|
||||||
|
|
||||||
Keycloakify lets you bundle an email theme however customization can't be made with React yet.
|
Keycloakify lets you bundle an email theme however customization can't be made with React yet.
|
||||||
@ -64,3 +57,40 @@ To initialize the email theme run:
|
|||||||
```bash
|
```bash
|
||||||
npx keycloakify initialize-email-theme
|
npx keycloakify initialize-email-theme
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Removing the account theme
|
||||||
|
|
||||||
|
If you don't need to customize [the account theme pages](https://storybook.keycloakify.dev/?path=/story/account-account--default).
|
||||||
|
You can remove the `src/account` directory.
|
||||||
|
This will significantly reduce the the size of the jar and the build time.
|
||||||
|
|
||||||
|
You'll need to apply theses changes to the `src/main.tsx` file:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
createRoot(document.getElementById("root")!).render(
|
||||||
|
<StrictMode>
|
||||||
|
<Suspense>
|
||||||
|
{(() => {
|
||||||
|
switch (window.kcContext?.themeType) {
|
||||||
|
case "login":
|
||||||
|
return <KcLoginThemeApp kcContext={window.kcContext} />;
|
||||||
|
- case "account":
|
||||||
|
- return <KcAccountThemeApp kcContext={window.kcContext} />;
|
||||||
|
case undefined:
|
||||||
|
return <h1>No Keycloak Context</h1>;
|
||||||
|
}
|
||||||
|
})()}
|
||||||
|
</Suspense>
|
||||||
|
</StrictMode>
|
||||||
|
);
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
kcContext?:
|
||||||
|
| import("./login/KcContext").KcContext
|
||||||
|
- | import("./account/KcContext").KcContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Don't forget to update `src/main.tsx` and `src/vite-env.d.ts`.
|
||||||
|
11
src/main.tsx
11
src/main.tsx
@ -9,7 +9,8 @@ import { getKcContextMock } from "./login/PageStory";
|
|||||||
|
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
window.kcContext = getKcContextMock({
|
window.kcContext = getKcContextMock({
|
||||||
pageId: "register.ftl"
|
pageId: "register.ftl",
|
||||||
|
overrides: {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
@ -33,3 +34,11 @@ createRoot(document.getElementById("root")!).render(
|
|||||||
</Suspense>
|
</Suspense>
|
||||||
</StrictMode>
|
</StrictMode>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
kcContext?:
|
||||||
|
| import("./login/KcContext").KcContext
|
||||||
|
| import("./account/KcContext").KcContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
9
src/vite-env.d.ts
vendored
9
src/vite-env.d.ts
vendored
@ -1,10 +1 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
import type { KcContext as KcContextLogin } from "./login/kcContext";
|
|
||||||
import type { KcContext as KcContextAccount } from "./account/kcContext";
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
kcContext?: KcContextLogin | KcContextAccount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user