Update
This commit is contained in:
1 parent
b6159180ea
commit
ca3f963f0b
7 files changed
+31
-23
No files matched your search
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"keycloakify": "10.0.0-rc.40",
|
"keycloakify": "10.0.0-rc.42",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import type { ClassKey } from "keycloakify/account";
|
import type { ClassKey } from "keycloakify/account";
|
||||||
import type { KcContext } from "./KcContext";
|
import type { KcContext } from "./KcContext";
|
||||||
import Fallback from "keycloakify/account/Fallback";
|
import { useI18n } from "./i18n";
|
||||||
|
import DefaultPage from "keycloakify/account/DefaultPage";
|
||||||
import Template from "keycloakify/account/Template";
|
import Template from "keycloakify/account/Template";
|
||||||
|
|
||||||
export default function KcApp(props: { kcContext: KcContext }) {
|
export default function KcApp(props: { kcContext: KcContext }) {
|
||||||
const { kcContext } = props;
|
const { kcContext } = props;
|
||||||
|
|
||||||
|
const { i18n } = useI18n({ kcContext });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense>
|
<Suspense>
|
||||||
{(() => {
|
{(() => {
|
||||||
switch (kcContext.pageId) {
|
switch (kcContext.pageId) {
|
||||||
default:
|
default:
|
||||||
return (
|
return (
|
||||||
<Fallback
|
<DefaultPage
|
||||||
kcContext={kcContext}
|
kcContext={kcContext}
|
||||||
|
i18n={i18n}
|
||||||
classes={classes}
|
classes={classes}
|
||||||
Template={Template}
|
Template={Template}
|
||||||
doUseDefaultCss={true}
|
doUseDefaultCss={true}
|
||||||
@@ -5,7 +5,7 @@ import type {
|
|||||||
KcContextExtension,
|
KcContextExtension,
|
||||||
KcContextExtensionPerPage
|
KcContextExtensionPerPage
|
||||||
} from "./KcContext";
|
} from "./KcContext";
|
||||||
import KcApp from "./KcApp";
|
import KcPage from "./KcPage";
|
||||||
import { themeNames, kcEnvDefaults } from "../kc.gen";
|
import { themeNames, kcEnvDefaults } from "../kc.gen";
|
||||||
|
|
||||||
const kcContextExtension: KcContextExtension = {
|
const kcContextExtension: KcContextExtension = {
|
||||||
@@ -23,12 +23,12 @@ export const { getKcContextMock } = createGetKcContextMock({
|
|||||||
overridesPerPage: {}
|
overridesPerPage: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
export function createPageStory<PageId extends KcContext["pageId"]>(params: {
|
export function createKcPageStory<PageId extends KcContext["pageId"]>(params: {
|
||||||
pageId: PageId;
|
pageId: PageId;
|
||||||
}) {
|
}) {
|
||||||
const { pageId } = params;
|
const { pageId } = params;
|
||||||
|
|
||||||
function PageStory(props: {
|
function KcPageStory(props: {
|
||||||
kcContext?: DeepPartial<Extract<KcContext, { pageId: PageId }>>;
|
kcContext?: DeepPartial<Extract<KcContext, { pageId: PageId }>>;
|
||||||
}) {
|
}) {
|
||||||
const { kcContext: overrides } = props;
|
const { kcContext: overrides } = props;
|
||||||
@@ -38,8 +38,8 @@ export function createPageStory<PageId extends KcContext["pageId"]>(params: {
|
|||||||
overrides
|
overrides
|
||||||
});
|
});
|
||||||
|
|
||||||
return <KcApp kcContext={kcContextMock} />;
|
return <KcPage kcContext={kcContextMock} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { PageStory };
|
return { KcPageStory };
|
||||||
}
|
}
|
||||||
Loaded 3 of 7 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user