mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-11-26 07:46:06 -05:00
refactor component/page function returns
This commit is contained in:
@@ -17,20 +17,22 @@ export type IFrameProps = ComponentProps<typeof RoundedIFrame> & {
|
||||
noScroll?: boolean;
|
||||
};
|
||||
|
||||
const IFrame = ({ src, title, height, width, allowScripts, noScroll, css, ...rest }: IFrameProps) => (
|
||||
<RoundedIFrame
|
||||
src={src}
|
||||
title={title}
|
||||
sandbox={allowScripts ? "allow-same-origin allow-scripts allow-popups" : undefined}
|
||||
scrolling={noScroll ? "no" : undefined}
|
||||
loading="lazy"
|
||||
css={{
|
||||
height: `${height}px`,
|
||||
maxWidth: width ? `${width}px` : "100%",
|
||||
...css,
|
||||
}}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
const IFrame = ({ src, title, height, width, allowScripts, noScroll, css, ...rest }: IFrameProps) => {
|
||||
return (
|
||||
<RoundedIFrame
|
||||
src={src}
|
||||
title={title}
|
||||
sandbox={allowScripts ? "allow-same-origin allow-scripts allow-popups" : undefined}
|
||||
scrolling={noScroll ? "no" : undefined}
|
||||
loading="lazy"
|
||||
css={{
|
||||
height: `${height}px`,
|
||||
maxWidth: width ? `${width}px` : "100%",
|
||||
...css,
|
||||
}}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default IFrame;
|
||||
|
||||
Reference in New Issue
Block a user