move service emoji colors to css

This commit is contained in:
slice 2018-07-22 11:52:54 -07:00
parent d66aa77aa7
commit 81147a373a
No known key found for this signature in database
GPG Key ID: 1508C19D7436A26D
2 changed files with 20 additions and 10 deletions

View File

@ -30,3 +30,15 @@
.service .description {
margin-top: 1em;
}
.service.service-alive .emoji {
color: #2ECC40;
}
.service.service-slow .emoji {
color: #FF851B;
}
.service.service-dead .emoji {
color: #FF4136;
}

View File

@ -1,5 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
@ -11,13 +12,6 @@ const {
slow_threshold: SLOW_THRESHOLD = 1500,
} = config
// from clrs.cc
const colors = {
alive: '#2ECC40',
slow: '#FF851B',
dead: '#FF4136',
}
const icons = {
alive: 'check-circle',
slow: 'exclamation-circle',
@ -43,13 +37,17 @@ export default function Service ({ graph, name, status, latency, description })
const title = titles[state]
const icon = icons[state]
const color = colors[state]
const className = classnames(
'service',
`service-${state}`
)
return (
<div className="service">
<div className={className}>
<header>
<div className="emoji" title={title}>
<FontAwesomeIcon title={title} icon={icon} style={{ color }}/>
<FontAwesomeIcon title={title} icon={icon}/>
</div>
<h2 className="title">
{name} {latency ? (