Storybook: add tooltip provider and sort stories (#30392)
* chore: add tooltip provider to storybook preview * chore: order story alphabetically
This commit is contained in:
@@ -6,6 +6,7 @@ import "./preview.css";
|
|||||||
import React, { useLayoutEffect } from "react";
|
import React, { useLayoutEffect } from "react";
|
||||||
import { FORCE_RE_RENDER } from "storybook/internal/core-events";
|
import { FORCE_RE_RENDER } from "storybook/internal/core-events";
|
||||||
import { setLanguage } from "../src/shared-components/i18n";
|
import { setLanguage } from "../src/shared-components/i18n";
|
||||||
|
import { TooltipProvider } from "@vector-im/compound-web";
|
||||||
|
|
||||||
export const globalTypes = {
|
export const globalTypes = {
|
||||||
theme: {
|
theme: {
|
||||||
@@ -82,9 +83,24 @@ export const withLanguageProvider: Decorator = (Story, context) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const withTooltipProvider: Decorator = (Story) => {
|
||||||
|
return (
|
||||||
|
<TooltipProvider>
|
||||||
|
<Story />
|
||||||
|
</TooltipProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const preview: Preview = {
|
const preview: Preview = {
|
||||||
tags: ["autodocs"],
|
tags: ["autodocs"],
|
||||||
decorators: [withThemeProvider, withLanguageProvider],
|
decorators: [withThemeProvider, withLanguageProvider, withTooltipProvider],
|
||||||
|
parameters: {
|
||||||
|
options: {
|
||||||
|
storySort: {
|
||||||
|
method: "alphabetical",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default preview;
|
export default preview;
|
||||||
|
|||||||
Reference in New Issue
Block a user