Flow for some more components

This commit is contained in:
Gregory Schier 2017-08-11 14:54:58 -07:00
parent c4933badba
commit c18d85b8dc
3 changed files with 19 additions and 21 deletions

View File

@ -229,7 +229,7 @@ class ResponsePane extends PureComponent {
<div className="no-wrap scrollable scrollable--no-bars pad-left">
<StatusTag
statusCode={response.statusCode}
statusMessage={response.statusMessage || null}
statusMessage={response.statusMessage}
/>
<TimeTag milliseconds={response.elapsedTime}/>
<SizeTag bytesRead={response.bytesRead} bytesContent={response.bytesContent}/>

View File

@ -1,10 +1,18 @@
// @flow
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {RESPONSE_CODE_DESCRIPTIONS, RESPONSE_CODE_REASONS} from '../../../common/constants';
import Tooltip from '../tooltip';
class StatusTag extends PureComponent {
props: {
statusCode: number,
// Optional
small?: boolean,
statusMessage?: string
};
render () {
const {statusMessage, statusCode, small} = this.props;
@ -59,13 +67,4 @@ class StatusTag extends PureComponent {
}
}
StatusTag.propTypes = {
// Required
statusCode: PropTypes.number.isRequired,
// Optional
small: PropTypes.bool,
statusMessage: PropTypes.string
};
export default StatusTag;

View File

@ -1,9 +1,17 @@
// @flow
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Tooltip from '../tooltip';
class TimeTag extends PureComponent {
props: {
milliseconds: number,
// Optional
small?: boolean,
className?: string
};
render () {
const {
milliseconds,
@ -42,13 +50,4 @@ class TimeTag extends PureComponent {
}
}
TimeTag.propTypes = {
// Required
milliseconds: PropTypes.number.isRequired,
// Optional
small: PropTypes.bool,
className: PropTypes.string
};
export default TimeTag;