Should render with a custom code block 1`] = `
>
diff --git a/src/components/component-playground.js b/src/components/component-playground.js
index 346881df5..ac4752f7b 100644
--- a/src/components/component-playground.js
+++ b/src/components/component-playground.js
@@ -18,13 +18,13 @@ export const PlaygroundProvider = styled(LiveProvider)`
overflow: hidden;
`;
-const PlaygroundPreview = styled(LivePreview)`
+const PlaygroundPreview = styled(({ className }) => (
+
+))`
padding: 0.5rem;
min-height: 100%;
- background: ${(props) => (
- props.previewBackgroundColor || '#fff'
- )};
+ background: ${p => p.previewBackgroundColor || '#fff'};
`;
const PlaygroundEditor = styled(LiveEditor)`
@@ -86,48 +86,63 @@ const PlaygroundError = styled(LiveError)`
padding: 0.5rem;
`;
-const ComponentPlayground = ({
- code,
- previewBackgroundColor,
- scope = {},
- theme = 'dark'
-}) => {
- const useDarkTheme = theme === 'dark';
-
- if (useDarkTheme) {
- require('../themes/default/prism.dark.css');
- } else {
- require('../themes/default/prism.light.css');
+class ComponentPlayground extends Component {
+ onKeyUp = evt => {
+ evt.stopPropagation();
+ };
+
+ onKeyDown = evt => {
+ evt.stopPropagation();
+ };
+
+ render() {
+ const {
+ code,
+ previewBackgroundColor,
+ scope = {},
+ theme = 'dark'
+ } = this.props;
+
+ const useDarkTheme = theme === 'dark';
+
+ if (useDarkTheme) {
+ require('../themes/default/prism.dark.css');
+ } else {
+ require('../themes/default/prism.light.css');
+ }
+
+ return (
+
+
+ Live Preview
+ Source Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
}
-
- return (
-
-
- Live Preview
- Source Code
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
+}
ComponentPlayground.propTypes = {
code: PropTypes.string,