1
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:
2022-05-25 09:30:11 -04:00
parent ff96ccae44
commit 1e1ecd89ea
31 changed files with 2347 additions and 2281 deletions

View File

@@ -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;