dappconnect-chat-sdk/packages/components/.storybook/preview.tsx

27 lines
564 B
TypeScript
Raw Normal View History

import React from 'react'
import { Provider, ToastContainer } from '../src'
2023-01-13 14:52:08 +00:00
import { Parameters, Decorator } from '@storybook/react'
2023-01-10 11:24:24 +00:00
import './reset.css'
import './components.css'
2023-01-13 14:52:08 +00:00
export const parameters: Parameters = {
2023-01-10 11:24:24 +00:00
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
2023-01-13 14:52:08 +00:00
date: /Date$/,
},
},
2023-01-10 11:24:24 +00:00
}
2023-01-13 14:52:08 +00:00
const withThemeProvider: Decorator = (Story, _context) => {
2023-01-10 11:24:24 +00:00
return (
2023-02-28 13:56:53 +00:00
<Provider>
2023-01-10 11:24:24 +00:00
<Story />
<ToastContainer />
2023-02-28 13:56:53 +00:00
</Provider>
2023-01-10 11:24:24 +00:00
)
}
export const decorators = [withThemeProvider]