mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
fix Zoom Props
This commit is contained in:
parent
6e969b558a
commit
f31bf0dc7c
@ -1,5 +1,5 @@
|
||||
import window from 'global';
|
||||
import React, { ReactElement, useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { styled } from '@storybook/theming';
|
||||
import ZoomIFrame, { IZoomIFrameProps } from './ZoomIFrame';
|
||||
|
||||
@ -20,8 +20,7 @@ const ZoomArea = styled.div<{ scale: number; height: number }>(({ scale = 1, hei
|
||||
|
||||
export type ZoomProps = {
|
||||
scale: number;
|
||||
children: ReactElement | ReactElement[] | Element | Element[];
|
||||
} & IZoomIFrameProps;
|
||||
} & Omit<IZoomIFrameProps, 'supportsCssZoom'>;
|
||||
|
||||
export function Zoom({ scale, children, src, title, allowFullScreen, active, id }: ZoomProps) {
|
||||
const componentWrapperRef = React.useRef<HTMLDivElement>(null);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { IframeHTMLAttributes } from 'react';
|
||||
import { styled } from '@storybook/theming';
|
||||
import { Zoom } from '@storybook/components';
|
||||
import { ScrollArea, Spaced, Zoom } from '@storybook/components';
|
||||
|
||||
const StyledIframe = styled.iframe({
|
||||
position: 'absolute',
|
||||
@ -23,9 +23,16 @@ export interface IFrameProps {
|
||||
}
|
||||
|
||||
export function IFrame(props: IFrameProps & IframeHTMLAttributes<HTMLIFrameElement>) {
|
||||
const { active, id, title, src, allowFullScreen, ...rest } = props;
|
||||
const { active, id, title, src, allowFullScreen, scale, ...rest } = props;
|
||||
return (
|
||||
<Zoom {...props}>
|
||||
<Zoom
|
||||
id={id}
|
||||
title={title}
|
||||
src={src}
|
||||
allowFullScreen={allowFullScreen}
|
||||
scale={scale}
|
||||
active={active}
|
||||
>
|
||||
<StyledIframe
|
||||
data-is-storybook={active ? 'true' : 'false'}
|
||||
id={id}
|
||||
|
Loading…
x
Reference in New Issue
Block a user