add proptypes to graph comp
This commit is contained in:
parent
50c479d6ea
commit
37dd98026d
2 changed files with 6 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import ms from 'ms';
|
||||
import { ResponsiveLine } from '@nivo/line';
|
||||
|
@ -6,6 +7,10 @@ import { ResponsiveLine } from '@nivo/line';
|
|||
import './Graph.css';
|
||||
|
||||
export default class Graph extends Component {
|
||||
static propTypes = {
|
||||
data: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number)).isRequired,
|
||||
}
|
||||
|
||||
state = {
|
||||
screenWidth: window.innerWidth,
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ const Service = ({ graph, name, status, latency, description }) => (
|
|||
<p className="description">
|
||||
{description}
|
||||
</p>
|
||||
{graph ? <Graph width={500} height={175} data={graph} /> : null}
|
||||
{graph ? <Graph data={graph} /> : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue