give service comp prop types

This commit is contained in:
Skip R. 2018-07-13 19:01:13 -07:00
parent 54df6d02e9
commit 267ddc890f
No known key found for this signature in database
GPG key ID: 1508C19D7436A26D
2 changed files with 17 additions and 0 deletions

View file

@ -10,6 +10,7 @@
"i": "^0.3.6",
"ms": "^2.1.1",
"npm": "^6.1.0",
"prop-types": "^15.6.2",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-placeholder": "^3.0.1",

View file

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
@ -29,4 +30,19 @@ const Service = ({ graph, name, status, latency, description }) => (
</div>
);
Service.defaultProps = {
graph: null,
latency: null,
};
Service.propTypes = {
graph: PropTypes.arrayOf(
PropTypes.arrayOf(PropTypes.number),
),
name: PropTypes.string.isRequired,
status: PropTypes.bool.isRequired,
latency: PropTypes.number,
description: PropTypes.string.isRequired,
};
export default Service;