mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Flow for some more components
This commit is contained in:
parent
c4933badba
commit
c18d85b8dc
@ -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}/>
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user