-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathpreview.js
More file actions
50 lines (45 loc) Β· 1.12 KB
/
preview.js
File metadata and controls
50 lines (45 loc) Β· 1.12 KB
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
44
45
46
47
48
49
50
/**
* TODO: Migrate RN Storybook from 6.5.x to 10 (RN 0.71 to 0.85.0-rc.1)
*/
/**
* ES6 mods not (yet) supported for typed .tsx
* Preserve .js ext for correct storybook.requires.js codegen
*/
// import { FC } from 'react'
import { withBackgrounds } from '@storybook/addon-ondevice-backgrounds'
import { StyleSheet, View } from 'react-native'
// import type { DecoratorFunction } from '@storybook/addon-actions'
/**
* @type decorators: DecoratorFunction[]
* @type StoryFn: FC
*/
export const decorators = [
StoryFn => (
// eslint-disable-next-line react/jsx-filename-extension
<View style={styles.container}>
<StoryFn />
</View>
),
withBackgrounds
]
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
backgrounds: {
default: 'plain',
values: [
{ name: 'plain', value: 'white' },
{ name: 'warm', value: 'hotpink' },
{ name: 'cool', value: 'deepskyblue' }
]
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
},
my_param: 'anything'
}
const styles = StyleSheet.create({
container: { flex: 1, padding: 8 }
})