File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 2424 "scripts" : {
2525 "build" : " babel --delete-dir-on-start --ignore '**/*.spec.js' --env-name cjs -d dist/ src/" ,
2626 "prepare" : " npm run build" ,
27- "test" : " echo \" Error: no test specified \" && exit 1 " ,
27+ "test" : " true " ,
2828 "posttest" : " npm run format" ,
2929 "slides:start" : " mdx-deck ./examples/example.mdx" ,
3030 "slides:build" : " mdx-deck build ./examples/example.mdx" ,
Original file line number Diff line number Diff line change 11/* @jsx jsx */
22import * as React from "react" ;
3+ import PropTypes from "prop-types" ;
34import { jsx , Box } from "theme-ui" ;
45
5- export default ( { src } ) => {
6+ function Demo ( { src, prodSrc } ) {
67 return (
78 < Box sx = { { position : "relative" } } >
89 < Box
@@ -20,9 +21,16 @@ export default ({ src }) => {
2021 } }
2122 />
2223 < iframe
23- src = { src }
24+ src = { prodSrc && process . env . NODE_ENV === "production" ? prodSrc : src }
2425 style = { { border : "none" , width : "100vw" , height : "100vh" } }
2526 />
2627 </ Box >
2728 ) ;
29+ }
30+
31+ Demo . propTypes = {
32+ src : PropTypes . string . isRequired ,
33+ prodSrc : PropTypes . string ,
2834} ;
35+
36+ export default Demo ;
You can’t perform that action at this time.
0 commit comments