forked from p34709852/monkey
Made statuslabel look better
This commit is contained in:
parent
e4cf3706ec
commit
3d96f71988
|
@ -2,22 +2,29 @@ import React, {Component, Fragment} from "react";
|
|||
import * as PropTypes from "prop-types";
|
||||
|
||||
const statusToIcon = {
|
||||
"Positive": "fa-check status-success",
|
||||
"Inconclusive": "fa-exclamation-triangle status-warning",
|
||||
"Conclusive": "fa-bomb status-danger",
|
||||
"Unexecuted": "fa-question status-default",
|
||||
"Positive": "fa-check",
|
||||
"Inconclusive": "fa-exclamation-triangle",
|
||||
"Conclusive": "fa-bomb",
|
||||
"Unexecuted": "fa-question",
|
||||
};
|
||||
|
||||
const statusToLabelType = {
|
||||
"Positive": "label-success",
|
||||
"Inconclusive": "label-warning",
|
||||
"Conclusive": "label-danger",
|
||||
"Unexecuted": "label-default",
|
||||
};
|
||||
|
||||
export class StatusLabel extends Component {
|
||||
render() {
|
||||
const classname = "fa " + statusToIcon[this.props.status] + " " + this.props.size;
|
||||
let text = "";
|
||||
if (this.props.showText) {
|
||||
text = " " + this.props.status;
|
||||
}
|
||||
return (<Fragment>
|
||||
<i className={classname}/>{text}
|
||||
</Fragment>);
|
||||
|
||||
return (<div className={"label " + statusToLabelType[this.props.status]} style={{display: "flow-root"}}>
|
||||
<i className={"fa " + statusToIcon[this.props.status] + " " + this.props.size}/>{text}
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue