File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ import {Button} from 'sentry/components/core/button';
17
17
import {IconAdd , IconDelete , IconEdit } from ' sentry/icons' ;
18
18
import * as Storybook from ' sentry/stories' ;
19
19
20
- import types from ' !!type-loader!sentry/components/core/alert/index' ;
20
+ import APIReference from ' !!type-loader!sentry/components/core/alert/index' ;
21
21
22
- export { types };
22
+ export const types = {Alert: APIReference . Alert };
23
23
24
24
To create a basic alert, wrap your message in an ` <Alert> ` component and specify the appropriate type.
25
25
Original file line number Diff line number Diff line change @@ -38,9 +38,9 @@ import {
38
38
} from ' sentry/icons' ;
39
39
import * as Storybook from ' sentry/stories' ;
40
40
41
- import types from ' !!type-loader!sentry/components/core/button/index' ;
41
+ import APIReference from ' !!type-loader!sentry/components/core/button/index' ;
42
42
43
- export { types };
43
+ export const types = {Button: APIReference . Button };
44
44
45
45
To create a basic button, wrap text in a ` <Button> ` and pass an ` onClick ` callback.
46
46
Original file line number Diff line number Diff line change @@ -148,7 +148,19 @@ function StoryUsage() {
148
148
function StoryAPI ( ) {
149
149
const { story} = useStory ( ) ;
150
150
if ( ! story . exports . types ) return null ;
151
- return < Storybook . APIReference types = { story . exports . types } /> ;
151
+
152
+ return (
153
+ < Fragment >
154
+ { Object . entries ( story . exports . types ) . map ( ( [ key , value ] ) => {
155
+ return (
156
+ < Storybook . APIReference
157
+ key = { key }
158
+ types = { value as TypeLoader . ComponentDocWithFilename }
159
+ />
160
+ ) ;
161
+ } ) }
162
+ </ Fragment >
163
+ ) ;
152
164
}
153
165
154
166
const StoryHeader = styled ( 'header' ) `
You can’t perform that action at this time.
0 commit comments