mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
4da1115a7c
* web: Update Storybook. Clean up theme styles. * web: Ignore Storybook output.
19 lines
668 B
TypeScript
19 lines
668 B
TypeScript
import { extendStorybookTheme } from "./theme.js";
|
|
|
|
import { createUIThemeEffect, resolveUITheme } from "@goauthentik/web/common/theme.ts";
|
|
|
|
import { DocsContainer, DocsContainerProps } from "@storybook/addon-docs/blocks";
|
|
import { useEffect, useMemo, useState } from "react";
|
|
|
|
export const ThemedDocsContainer: React.FC<DocsContainerProps> = ({
|
|
theme: initialTheme = resolveUITheme(),
|
|
...props
|
|
}) => {
|
|
const [theme, setTheme] = useState(initialTheme);
|
|
const resolvedTheme = useMemo(() => extendStorybookTheme(theme), [theme]);
|
|
|
|
useEffect(() => createUIThemeEffect(setTheme), []);
|
|
|
|
return <DocsContainer {...props} theme={resolvedTheme} />;
|
|
};
|