Merge pull request #2835 from shockey/ft/cleanup
Removed unused packages from dependencies
This commit is contained in:
@@ -38,13 +38,11 @@
|
|||||||
"babel-polyfill": "^6.23.0",
|
"babel-polyfill": "^6.23.0",
|
||||||
"brace": "0.7.0",
|
"brace": "0.7.0",
|
||||||
"btoa": "^1.1.2",
|
"btoa": "^1.1.2",
|
||||||
"debounce": "1.0.0",
|
|
||||||
"deep-extend": "0.4.1",
|
"deep-extend": "0.4.1",
|
||||||
"expect": "1.20.2",
|
"expect": "1.20.2",
|
||||||
"getbase": "^2.8.2",
|
"getbase": "^2.8.2",
|
||||||
"immutable": "^3.x.x",
|
"immutable": "^3.x.x",
|
||||||
"js-yaml": "^3.5.5",
|
"js-yaml": "^3.5.5",
|
||||||
"jsonschema": "^1.1.0",
|
|
||||||
"less": "2.7.1",
|
"less": "2.7.1",
|
||||||
"lodash": "4.17.2",
|
"lodash": "4.17.2",
|
||||||
"matcher": "^0.1.2",
|
"matcher": "^0.1.2",
|
||||||
@@ -74,8 +72,7 @@
|
|||||||
"whatwg-fetch": "0.11.1",
|
"whatwg-fetch": "0.11.1",
|
||||||
"worker-loader": "^0.7.1",
|
"worker-loader": "^0.7.1",
|
||||||
"xml": "1.0.1",
|
"xml": "1.0.1",
|
||||||
"yaml-js": "^0.1.3",
|
"yaml-js": "^0.1.3"
|
||||||
"yaml-worker": "^2.1.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "6.6.1",
|
"autoprefixer": "6.6.1",
|
||||||
|
|||||||
@@ -48,43 +48,48 @@ export default class OnlineValidatorBadge extends React.Component {
|
|||||||
|
|
||||||
|
|
||||||
class ValidatorImage extends React.Component {
|
class ValidatorImage extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
src: PropTypes.string,
|
||||||
|
alt: PropTypes.string
|
||||||
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
error: false
|
error: false
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const img = new Image();
|
const img = new Image()
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
loaded: true
|
loaded: true
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
img.onerror = () => {
|
img.onerror = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
error: true
|
error: true
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
img.src = this.props.src;
|
img.src = this.props.src
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (nextProps.src !== this.props.src) {
|
if (nextProps.src !== this.props.src) {
|
||||||
const img = new Image();
|
const img = new Image()
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
loaded: true
|
loaded: true
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
img.onerror = () => {
|
img.onerror = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
error: true
|
error: true
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
img.src = nextProps.src;
|
img.src = nextProps.src
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user