Skip to content

Commit 72cbfa2

Browse files
committed
stories: fix api reference table
1 parent 3827265 commit 72cbfa2

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

static/app/components/core/alert/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import {Button} from 'sentry/components/core/button';
1717
import {IconAdd, IconDelete, IconEdit} from 'sentry/icons';
1818
import * as Storybook from 'sentry/stories';
1919

20-
import types from '!!type-loader!sentry/components/core/alert/index';
20+
import APIReference from '!!type-loader!sentry/components/core/alert/index';
2121

22-
export {types};
22+
export const types = {Alert: APIReference.Alert};
2323

2424
To create a basic alert, wrap your message in an `<Alert>` component and specify the appropriate type.
2525

static/app/components/core/button/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ import {
3838
} from 'sentry/icons';
3939
import * as Storybook from 'sentry/stories';
4040

41-
import types from '!!type-loader!sentry/components/core/button/index';
41+
import APIReference from '!!type-loader!sentry/components/core/button/index';
4242

43-
export {types};
43+
export const types = {Button: APIReference.Button};
4444

4545
To create a basic button, wrap text in a `<Button>` and pass an `onClick` callback.
4646

static/app/stories/view/storyExports.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,19 @@ function StoryUsage() {
148148
function StoryAPI() {
149149
const {story} = useStory();
150150
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+
);
152164
}
153165

154166
const StoryHeader = styled('header')`

0 commit comments

Comments
 (0)