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";
|
import * as PropTypes from "prop-types";
|
||||||
|
|
||||||
const statusToIcon = {
|
const statusToIcon = {
|
||||||
"Positive": "fa-check status-success",
|
"Positive": "fa-check",
|
||||||
"Inconclusive": "fa-exclamation-triangle status-warning",
|
"Inconclusive": "fa-exclamation-triangle",
|
||||||
"Conclusive": "fa-bomb status-danger",
|
"Conclusive": "fa-bomb",
|
||||||
"Unexecuted": "fa-question status-default",
|
"Unexecuted": "fa-question",
|
||||||
|
};
|
||||||
|
|
||||||
|
const statusToLabelType = {
|
||||||
|
"Positive": "label-success",
|
||||||
|
"Inconclusive": "label-warning",
|
||||||
|
"Conclusive": "label-danger",
|
||||||
|
"Unexecuted": "label-default",
|
||||||
};
|
};
|
||||||
|
|
||||||
export class StatusLabel extends Component {
|
export class StatusLabel extends Component {
|
||||||
render() {
|
render() {
|
||||||
const classname = "fa " + statusToIcon[this.props.status] + " " + this.props.size;
|
|
||||||
let text = "";
|
let text = "";
|
||||||
if (this.props.showText) {
|
if (this.props.showText) {
|
||||||
text = " " + this.props.status;
|
text = " " + this.props.status;
|
||||||
}
|
}
|
||||||
return (<Fragment>
|
|
||||||
<i className={classname}/>{text}
|
return (<div className={"label " + statusToLabelType[this.props.status]} style={{display: "flow-root"}}>
|
||||||
</Fragment>);
|
<i className={"fa " + statusToIcon[this.props.status] + " " + this.props.size}/>{text}
|
||||||
|
</div>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue