-
-
Notifications
You must be signed in to change notification settings - Fork 165
/
Copy pathpreview.tsx
43 lines (41 loc) · 1.08 KB
/
preview.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { View, Appearance } from 'react-native';
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds';
import { definePreview } from '@storybook/react/preview';
const preview = definePreview({
decorators: [
(Story) => (
<View style={{ padding: 8, flex: 1 }}>
<Story />
</View>
),
withBackgrounds,
],
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
options: {
storySort: {
method: 'alphabetical',
includeNames: true,
order: ['ControlExamples', ['ControlExample'], 'InteractionExample', 'DeepControls'],
},
},
hideFullScreenButton: false,
noSafeArea: false,
my_param: 'anything',
backgrounds: {
default: Appearance.getColorScheme() === 'dark' ? 'dark' : 'plain',
values: [
{ name: 'plain', value: 'white' },
{ name: 'dark', value: '#333' },
{ name: 'app', value: '#eeeeee' },
],
},
},
});
export default preview;