Made statuslabel look better

This commit is contained in:
Shay Nehmad 2019-08-15 10:54:30 +03:00
parent e4cf3706ec
commit 3d96f71988
1 changed files with 15 additions and 8 deletions

View File

@ -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>);
} }
} }