1- import React from 'react' ;
2- import PropTypes from 'prop-types' ;
1+ import React from "react" ;
32
43class Gist extends React . PureComponent {
54 componentDidMount ( ) {
65 this . _updateIframeContent ( ) ;
76 }
87
9- componentDidUpdate ( prevProps , prevState ) {
8+ componentDidUpdate ( _prevProps , _prevState ) {
109 this . _updateIframeContent ( ) ;
1110 }
1211
1312 _defineUrl ( ) {
1413 const { id, file } = this . props ;
1514
16- const fileArg = file ? `?file=${ file } ` : '' ;
15+ const fileArg = file ? `?file=${ file } ` : "" ;
1716
1817 return `https://gist.github.com/${ id } .js${ fileArg } ` ;
1918 }
@@ -27,9 +26,9 @@ class Gist extends React.PureComponent {
2726 if ( iframe . contentDocument ) doc = iframe . contentDocument ;
2827 else if ( iframe . contentWindow ) doc = iframe . contentWindow . document ;
2928
30- const gistLink = this . _defineUrl ( )
29+ const gistLink = this . _defineUrl ( ) ;
3130 const gistScript = `<script type="text/javascript" src="${ gistLink } "></script>` ;
32- const styles = ' <style>*{font-size:12px;}</style>' ;
31+ const styles = " <style>*{font-size:12px;}</style>" ;
3332 const elementId = file ? `gist-${ id } -${ file } ` : `gist-${ id } ` ;
3433 const resizeScript = `onload="parent.document.getElementById('${ elementId } ').style.height=document.body.scrollHeight + 'px'"` ;
3534 const iframeHtml = `<html><head><base target="_parent">${ styles } </head><body ${ resizeScript } >${ gistScript } </body></html>` ;
@@ -44,7 +43,9 @@ class Gist extends React.PureComponent {
4443
4544 return (
4645 < iframe
47- ref = { ( n ) => { this . iframeNode = n ; } }
46+ ref = { ( n ) => {
47+ this . iframeNode = n ;
48+ } }
4849 width = "100%"
4950 frameBorder = { 0 }
5051 id = { file ? `gist-${ id } -${ file } ` : `gist-${ id } ` }
0 commit comments