-
Notifications
You must be signed in to change notification settings - Fork 646
Expand file tree
/
Copy pathExample.js
More file actions
33 lines (29 loc) · 829 Bytes
/
Example.js
File metadata and controls
33 lines (29 loc) · 829 Bytes
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
import React from 'react';
import PropTypes from 'prop-types';
import { Grid } from 'react-bootstrap';
const propTypes = {
codeSandbox: PropTypes.shape({
title: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
}).isRequired,
};
const Example = ({ codeSandbox }) => (
<div>
<Grid>
<h2>Example</h2>
</Grid>
<div
dangerouslySetInnerHTML={{
__html: `
<iframe
title="${codeSandbox.title}"
src="https://codesandbox.io/embed/${codeSandbox.id}?fontsize=14"
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
/>`,
}}
/>
</div>
);
Example.propTypes = propTypes;
export default Example;