mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-09-18 16:05:33 -04:00
move some non-post pages to mdx
This commit is contained in:
32
components/CodePen/CodePen.tsx
Normal file
32
components/CodePen/CodePen.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
export type CodePenProps = {
|
||||
username: string;
|
||||
id: string;
|
||||
height?: number;
|
||||
defaultTab?: string;
|
||||
preview?: boolean;
|
||||
editable?: boolean;
|
||||
};
|
||||
|
||||
const CodePen = ({
|
||||
username,
|
||||
id,
|
||||
height = 500,
|
||||
defaultTab = "html",
|
||||
preview = true,
|
||||
editable = false,
|
||||
}: CodePenProps) => {
|
||||
return (
|
||||
<iframe
|
||||
src={`https://codepen.io/${username}/embed/${id}/?${new URLSearchParams({
|
||||
"default-tab": `${defaultTab},result`,
|
||||
preview: `${!!preview}`,
|
||||
editable: `${!!editable}`,
|
||||
})}`}
|
||||
scrolling="no"
|
||||
sandbox="allow-same-origin allow-scripts allow-popups allow-top-navigation-by-user-activation"
|
||||
style={{ height: `${height}px`, width: "100%", border: "0" }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default CodePen;
|
2
components/CodePen/index.ts
Normal file
2
components/CodePen/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./CodePen";
|
||||
export { default } from "./CodePen";
|
Reference in New Issue
Block a user