-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import * as React from 'react'; | ||
import {storiesOf} from '@storybook/react'; | ||
import Embed from '..'; | ||
import {Box} from './Box'; | ||
|
||
storiesOf('codesandbox', module) | ||
.add('Default', () => { | ||
return <Embed url={'https://codesandbox.io/embed/react-new?fontsize=14&hidenavigation=1&theme=dark'} />; | ||
}) | ||
.add('Fitted', () => { | ||
return ( | ||
<Box> | ||
<Embed url={'https://codesandbox.io/embed/react-new?fontsize=14&hidenavigation=1&theme=dark'} /> | ||
</Box> | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as React from 'react'; | ||
import {BlockProps} from '../..'; | ||
|
||
export interface CodeSandboxProps extends BlockProps {} | ||
|
||
const CodeSandbox: React.FC<CodeSandboxProps> = ({ | ||
url, | ||
renderWrap, | ||
}) => { | ||
|
||
return renderWrap( | ||
<iframe | ||
src={url} | ||
style={{ | ||
width: '100%', | ||
height: '500px', | ||
border: 0, | ||
borderRadius: '4px', | ||
overflow: 'hidden', | ||
}} | ||
width="100%" | ||
height="500" | ||
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" | ||
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" | ||
/> | ||
); | ||
}; | ||
|
||
export default CodeSandbox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters