use class for section color

This commit is contained in:
Matthias Hannig 2018-09-10 16:50:30 +02:00
parent c393b74bca
commit 4a4e1ac981
2 changed files with 14 additions and 9 deletions

View File

@ -247,4 +247,16 @@ $labelOffsetEnd: -30px;
}
}
.card-header-routes {
&.received {
color: green;
}
&.filtered {
color: orange;
}
&.notexported {
color: red;
}
}

View File

@ -22,20 +22,13 @@ import {ROUTES_RECEIVED,
const RoutesHeader = (props) => {
const type = props.type;
const color = {
[ROUTES_RECEIVED]: "green",
[ROUTES_FILTERED]: "orange",
[ROUTES_NOT_EXPORTED]: "red"
}[type];
const rtype = {
[ROUTES_RECEIVED]: "accepted",
[ROUTES_FILTERED]: "filtered",
[ROUTES_NOT_EXPORTED]: "not exported"
}[type];
return (<p className="routes-header"
style={{"color": color, "textTransform": "uppercase"}}>
Routes {rtype}
</p>);
const cls = `card-header card-header-routes ${type.toLowerCase()}`;
return (<p className={cls}>Routes {rtype}</p>);
};
/*