Skip to content

Commit

Permalink
fix: storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
martyanovandrey committed Feb 26, 2024
1 parent 2b89765 commit 5c00166
Show file tree
Hide file tree
Showing 5 changed files with 4,883 additions and 3,694 deletions.
11 changes: 11 additions & 0 deletions demo/.storybook/decorators/withTheme.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import type {Decorator} from '@storybook/react';
import {ThemeProvider} from '@gravity-ui/uikit';

export const WithTheme: Decorator = (Story, context) => {
return (
<ThemeProvider theme={context.globals.theme}>
<Story />
</ThemeProvider>
);
};
5 changes: 4 additions & 1 deletion demo/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/** @type { import('@storybook/react').Preview } */
import { Preview } from '@storybook/react';
import type {Preview} from '@storybook/react';

import {WithTheme} from './decorators/withTheme';

import './global.css';

const preview: Preview = {
decorators: [WithTheme],
parameters: {
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
Expand Down
Loading

0 comments on commit 5c00166

Please sign in to comment.