keycloak-scim/src/stories/HelpSystem.stories.tsx
2020-09-03 13:26:36 -04:00

49 lines
1,016 B
TypeScript

import React, { useContext } from "react";
import {
Page,
PageHeader,
PageHeaderTools,
PageHeaderToolsItem,
} from "@patternfly/react-core";
import { Meta } from "@storybook/react/types-6-0";
import {
Help,
HelpContext,
HelpHeader,
} from "../components/help-enabler/HelpHeader";
export default {
title: "Help System Example",
component: HelpHeader,
} as Meta;
export const HelpSystem = () => {
return (
<Help>
<HelpSystemTest />
</Help>
);
};
const HelpSystemTest = () => {
const { enabled } = useContext(HelpContext);
return (
<Page
header={
<PageHeader
headerTools={
<PageHeaderTools>
<PageHeaderToolsItem>
<HelpHeader />
</PageHeaderToolsItem>
<PageHeaderToolsItem>dummy user...</PageHeaderToolsItem>
</PageHeaderTools>
}
/>
}
>
Help system is {enabled ? "enabled" : "not on, guess you don't need help"}
</Page>
);
};