mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-18 05:02:24 +08:00
enable toolbars for Preview blocks with multiple children, because it works now
This commit is contained in:
parent
9519ee95f7
commit
b3a146b7ad
@ -164,18 +164,9 @@ const Preview: FunctionComponent<PreviewProps> = ({
|
||||
const [scale, setScale] = useState(1);
|
||||
const previewClasses = className ? `${className} sbdocs sbdocs-preview` : 'sbdocs sbdocs-preview';
|
||||
|
||||
if (withToolbar && Array.isArray(children)) {
|
||||
logger.warn('Cannot use toolbar with multiple preview children, disabling');
|
||||
}
|
||||
const showToolbar = withToolbar && !Array.isArray(children);
|
||||
|
||||
return (
|
||||
<PreviewContainer
|
||||
{...{ withSource, withToolbar: showToolbar }}
|
||||
{...props}
|
||||
className={previewClasses}
|
||||
>
|
||||
{showToolbar && (
|
||||
<PreviewContainer {...{ withSource, withToolbar }} {...props} className={previewClasses}>
|
||||
{withToolbar && (
|
||||
<PositionedToolbar
|
||||
border
|
||||
zoom={(z) => setScale(scale * z)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user