Basic storybook setup and update readme

This commit is contained in:
garronej
2023-04-17 01:24:05 +02:00
parent f22be4cc0b
commit 58222f4b95
7 changed files with 63 additions and 22 deletions

View File

@ -1,5 +1,5 @@
.my-root-class {
.my-root-account-class {
background: url(./assets/background.svg) no-repeat center center fixed;
}

View File

@ -13,7 +13,7 @@ const MyExtraPage2 = lazy(() => import("./pages/MyExtraPage2"));
const Fallback = lazy(()=> import("keycloakify/account"));
const classes: PageProps<any, any>["classes"] = {
"kcBodyClass": "my-root-class"
"kcBodyClass": "my-root-account-class"
};
export default function KcApp(props: { kcContext: KcContext; }) {

View File

@ -0,0 +1,23 @@
//This is to show that you can create stories for pages that you haven't overloaded.
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { createPageStory } from "../createPageStory";
const { PageStory } = createPageStory({
pageId: "login-reset-password.ftl"
});
export default {
title: "login/LoginResetPassword",
component: PageStory,
} as ComponentMeta<typeof PageStory>;
export const Default: ComponentStory<typeof PageStory> = () => <PageStory />;
export const WithEmailAsUsername: ComponentStory<typeof PageStory> = () => (
<PageStory
kcContext={{
realm: { loginWithEmailAllowed: true, registrationEmailAsUsername: true }
}}
/>
);

View File

@ -0,0 +1,13 @@
import { ComponentStory, ComponentMeta } from '@storybook/react';
import { createPageStory } from "../createPageStory";
const { PageStory } = createPageStory({
pageId: "terms.ftl"
});
export default {
title: "login/Terms",
component: PageStory,
} as ComponentMeta<typeof PageStory>;
export const Primary: ComponentStory<typeof PageStory> = () => <PageStory />;