mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
added support for classnames on preview component
This commit is contained in:
parent
4e41694820
commit
148aaae8c7
@ -150,6 +150,7 @@ const Preview: FunctionComponent<PreviewProps> = ({
|
||||
const [expanded, setExpanded] = useState(isExpanded);
|
||||
const { source, actionItem } = getSource(withSource, expanded, setExpanded);
|
||||
const [scale, setScale] = useState(1);
|
||||
const previewClasses = className ? `${className} sbdocs-preview` : 'sbdocs-preview';
|
||||
|
||||
if (withToolbar && Array.isArray(children)) {
|
||||
logger.warn('Cannot use toolbar with multiple preview children, disabling');
|
||||
@ -159,7 +160,7 @@ const Preview: FunctionComponent<PreviewProps> = ({
|
||||
<PreviewContainer
|
||||
{...{ withSource, withToolbar: showToolbar }}
|
||||
{...props}
|
||||
className="sbdocs-preview"
|
||||
className={previewClasses}
|
||||
>
|
||||
{showToolbar && (
|
||||
<PositionedToolbar
|
||||
|
Loading…
x
Reference in New Issue
Block a user