Skip to content

Commit

Permalink
feat/storybook: add basic decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTK committed Apr 8, 2021
1 parent f8a1163 commit fc38c9d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .storybook/decorators.js
@@ -0,0 +1,20 @@
import React from 'react';
import { Provider } from 'react-redux';
import store from '../src/store/new-order-store';

const withAppWrapper = (Story) => (
<div className="App">
<Story />
</div>
);

const withProvider = (Story) => (
<Provider store={store}>
<Story />
</Provider>
);

export {
withAppWrapper,
withProvider,
}
11 changes: 9 additions & 2 deletions .storybook/preview.js
@@ -1,4 +1,6 @@
import 'antd/dist/antd.css';
import { withAppWrapper, withProvider } from './decorators';
import '../src/App.scss';
import '../src/index.css';

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand All @@ -8,4 +10,9 @@ export const parameters = {
date: /Date$/,
},
},
}
};

export const decorators = [
withAppWrapper,
withProvider,
];

0 comments on commit fc38c9d

Please sign in to comment.