forked from remix-run/react-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSandboxExample.js
More file actions
50 lines (48 loc) · 1.07 KB
/
SandboxExample.js
File metadata and controls
50 lines (48 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from "react";
import PropTypes from "prop-types";
import { SandboxEmbed } from "@codesandbox/react-embed";
export default function SandboxExample({
label,
path,
dependencies,
code,
extraEmbedOptions = {}
}) {
return (
<SandboxEmbed
sandboxOptions={{
name: `React Router - ${label}`,
examplePath: path,
gitInfo: {
account: "remix-run",
repository: "react-router",
host: "github",
branch: "v5"
},
dependencies: dependencies,
example: code
}}
embedOptions={{
codemirror: true,
fontsize: 14,
...extraEmbedOptions
}}
height="100vh"
>
<div
style={{
width: "100%",
height: "100vh",
backgroundColor: "#1C1F21"
}}
/>
</SandboxEmbed>
);
}
SandboxExample.propTypes = {
label: PropTypes.string.isRequired,
path: PropTypes.string.isRequired,
dependencies: PropTypes.object.isRequired,
code: PropTypes.string.isRequired,
extraEmbedOptions: PropTypes.object
};