mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
cleanup
This commit is contained in:
parent
aac1767873
commit
6464cc2ea3
@ -36,6 +36,9 @@ type DeprecatedCanvasProps = {
|
||||
* @deprecated use `source.code` instead
|
||||
*/
|
||||
mdxSource?: string;
|
||||
/**
|
||||
* @deprecated reference stories with the `of` prop instead
|
||||
*/
|
||||
children?: ReactNode;
|
||||
};
|
||||
|
||||
@ -184,12 +187,12 @@ export const Canvas: FC<CanvasProps & DeprecatedCanvasProps> = (props) => {
|
||||
}
|
||||
|
||||
const layout =
|
||||
props.layout ?? story.parameters?.layout ?? story.parameters?.docs?.canvas?.layout ?? 'padded';
|
||||
const withToolbar = props.withToolbar ?? story.parameters?.docs?.canvas?.withToolbar ?? false;
|
||||
props.layout ?? story.parameters.layout ?? story.parameters.docs?.canvas?.layout ?? 'padded';
|
||||
const withToolbar = props.withToolbar ?? story.parameters.docs?.canvas?.withToolbar ?? false;
|
||||
const additionalActions =
|
||||
props.additionalActions ?? story.parameters?.docs?.canvas?.additionalActions;
|
||||
const sourceState = props.sourceState ?? story.parameters?.docs?.canvas?.sourceState ?? 'hidden';
|
||||
const className = props.className ?? story.parameters?.docs?.canvas?.className;
|
||||
props.additionalActions ?? story.parameters.docs?.canvas?.additionalActions;
|
||||
const sourceState = props.sourceState ?? story.parameters.docs?.canvas?.sourceState ?? 'hidden';
|
||||
const className = props.className ?? story.parameters.docs?.canvas?.className;
|
||||
|
||||
return (
|
||||
<PurePreview
|
||||
|
@ -15,14 +15,13 @@ export const DocsStory: FC<DocsStoryProps> = ({
|
||||
__primary = false,
|
||||
}) => {
|
||||
const { story } = useOf(of || 'story', ['story']);
|
||||
const description = story.parameters?.docs?.description?.story;
|
||||
|
||||
return (
|
||||
<Anchor storyId={story.id}>
|
||||
{expanded && (
|
||||
<>
|
||||
<Subheading>{story.name}</Subheading>
|
||||
{description !== undefined && <Description markdown={description} />}
|
||||
<Description of={of} />
|
||||
</>
|
||||
)}
|
||||
<Canvas of={of} withToolbar={withToolbar} story={{ __forceInitialArgs, __primary }} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user