mirror of
https://github.com/morten-olsen/react-native-ref.git
synced 2026-02-08 00:36:24 +01:00
init
This commit is contained in:
40
packages/ui/.storybook/preview.tsx
Normal file
40
packages/ui/.storybook/preview.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import { Decorator, Parameters } from '@storybook/react';
|
||||
import "@fontsource/montserrat";
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
import { theme } from './theme';
|
||||
import { Provider, light } from '../src/theme/theme';
|
||||
|
||||
const ThemeDecorator: Decorator = (storyFn) => (
|
||||
<ThemeProvider theme={theme}>
|
||||
<Provider theme={light}>{storyFn()}</Provider>
|
||||
</ThemeProvider>
|
||||
)
|
||||
|
||||
export const decorators = [ThemeDecorator];
|
||||
|
||||
export const parameters: Parameters = {
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
backgrounds: {
|
||||
default: 'dark',
|
||||
values: [
|
||||
{
|
||||
name: 'dark',
|
||||
value: '#444',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
name: 'light',
|
||||
value: '#ddd',
|
||||
},
|
||||
],
|
||||
},
|
||||
docs: {
|
||||
// theme,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user