keycloak_theme/stories/login/pages/Info.stories.tsx

97 lines
2.4 KiB
TypeScript
Raw Normal View History

2023-04-20 05:41:34 +02:00
import React from "react";
2024-06-03 00:11:19 +02:00
import type { Meta, StoryObj } from "@storybook/react";
2024-06-09 11:53:25 +02:00
import { createKcPageStory } from "../KcPageStory";
2023-04-20 05:41:34 +02:00
2024-06-09 11:53:25 +02:00
const { KcPageStory } = createKcPageStory({ pageId: "info.ftl" });
2023-04-20 05:41:34 +02:00
2024-06-03 00:11:19 +02:00
const meta = {
2024-06-06 07:28:34 +02:00
title: "login/info.ftl",
2024-06-09 11:53:25 +02:00
component: KcPageStory
} satisfies Meta<typeof KcPageStory>;
2023-04-20 05:41:34 +02:00
export default meta;
2024-06-03 00:11:19 +02:00
type Story = StoryObj<typeof meta>;
export const Default: Story = {
render: () => (
2024-06-09 11:53:25 +02:00
<KcPageStory
2024-06-03 00:11:19 +02:00
kcContext={{
message: {
2024-06-03 23:40:21 +02:00
summary: "Server info message"
2024-06-03 00:11:19 +02:00
}
}}
/>
)
};
2024-06-03 00:11:19 +02:00
export const WithLinkBack: Story = {
render: () => (
2024-06-09 11:53:25 +02:00
<KcPageStory
2024-06-03 00:11:19 +02:00
kcContext={{
message: {
summary: "Server message"
},
actionUri: undefined
}}
/>
)
};
2024-06-03 00:11:19 +02:00
export const WithRequiredActions: Story = {
render: () => (
2024-06-09 11:53:25 +02:00
<KcPageStory
2024-06-03 00:11:19 +02:00
kcContext={{
message: {
summary: "Required actions: "
2024-06-03 00:11:19 +02:00
},
requiredActions: ["CONFIGURE_TOTP", "UPDATE_PROFILE", "VERIFY_EMAIL", "CUSTOM_ACTION"],
"x-keycloakify": {
messages: {
"requiredAction.CUSTOM_ACTION": "Custom action"
}
}
2024-06-03 00:11:19 +02:00
}}
/>
)
};
export const WithPageRedirect: Story = {
render: () => (
<KcPageStory
kcContext={{
message: { summary: "You will be redirected shortly." },
pageRedirectUri: "https://example.com"
}}
/>
)
};
export const WithoutClientBaseUrl: Story = {
render: () => (
<KcPageStory
kcContext={{
message: { summary: "No client base URL defined." },
client: { baseUrl: undefined }
}}
/>
)
};
export const WithMessageHeader: Story = {
render: () => (
<KcPageStory
kcContext={{
messageHeader: "Important Notice",
message: { summary: "This is an important message." }
}}
/>
)
};
export const WithAdvancedMessage: Story = {
render: () => (
<KcPageStory
kcContext={{
message: { summary: "Please take note of this <strong>important</strong> information." }
}}
/>
)
};