Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7c20d8c

Browse files
committed
chore: Update dev dependencies
1 parent 02941b3 commit 7c20d8c

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

‎package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@
3131
"url": "http://tommyleunen.com/"
3232
},
3333
"license": "MIT",
34-
"dependencies": {
35-
"prop-types": "^15.6.0"
36-
},
34+
"dependencies": {},
3735
"devDependencies": {
38-
"nwb": "^0.20.0",
39-
"react": "^16.2.0",
40-
"react-dom": "^16.2.0"
36+
"nwb": "^0.25.2",
37+
"react": "^17.0.2",
38+
"react-dom": "^17.0.2"
4139
},
4240
"peerDependencies": {
4341
"react": "0.14.x || ^15.0.0-rc || ^16.0.0-rc || ^17.0.0-rc"

‎src/index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
1+
import React from "react";
32

43
class 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

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /