Skip to content

Commit

Permalink
chore(webapp): use LightIcon in block producers health indicators
Browse files Browse the repository at this point in the history
- Change Healthcheck icons
- Remove tooltip from bpjson health check
  • Loading branch information
Torresmorah committed Nov 2, 2022
1 parent 3bd4593 commit 6f9458f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 32 deletions.
16 changes: 8 additions & 8 deletions webapp/src/components/HealthCheck/LightIcon.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import { makeStyles } from '@mui/styles'
import ReportIcon from '@mui/icons-material/Report'
import VerifiedIcon from '@mui/icons-material/Verified'
import TimerOffIcon from '@mui/icons-material/TimerOff'
import WarningIcon from '@mui/icons-material/Warning'
import CloseIcon from '@mui/icons-material/Close'
import DoneOutlinedIcon from '@mui/icons-material/DoneOutlined'
import TimerOffOutlinedIcon from '@mui/icons-material/TimerOffOutlined'
import ReportProblemOutlinedIcon from '@mui/icons-material/ReportProblemOutlined'

import styles from './styles'

Expand All @@ -14,13 +14,13 @@ const LightIcon = ({ status }) => {

switch (status) {
case 'greenLight':
return <VerifiedIcon className={classes.greenLight} />
return <DoneOutlinedIcon className={classes.greenLight} />
case 'timerOff':
return <TimerOffIcon className={classes.timerOff} />
return <TimerOffOutlinedIcon className={classes.timerOff} />
case 'yellowLight':
return <WarningIcon className={classes.yellowLight} />
return <ReportProblemOutlinedIcon className={classes.yellowLight} />
default:
return <ReportIcon className={classes.redLight} />
return <CloseIcon className={classes.redLight} />
}
}

Expand Down
14 changes: 7 additions & 7 deletions webapp/src/components/HealthCheck/styles.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default (theme) => ({
icon: {
'& svg': {
width: '16px !important',
height: '16px !important',
width: '20px !important',
height: '20px !important',
cursor: 'pointer',
},
},
Expand All @@ -29,18 +29,18 @@ export default (theme) => ({
cursor: 'pointer',
},
greenLight: {
color: 'darkgreen',
color: theme.palette.success.main,
},
timerOff: {
color: 'orange',
},
yellowLight: {
color: 'orangered',
color: theme.palette.warning.main,
},
redLight: {
color: 'darkred',
color: theme.palette.error.main,
},
test: {
boxShadow: '10px 5px 5px red !important'
}
boxShadow: '10px 5px 5px red !important',
},
})
4 changes: 2 additions & 2 deletions webapp/src/components/NodeCard/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export default (theme) => ({
fontWeight: 'normal',
marginLeft: theme.spacing(3),
'& svg': {
width: '15px',
height: '15px',
width: '20px',
height: '20px',
alignSelf: 'center',
marginLeft: theme.spacing(2),
},
Expand Down
26 changes: 11 additions & 15 deletions webapp/src/components/ProducerHealthIndicators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
import React from 'react'
import PropTypes from 'prop-types'
import { makeStyles } from '@mui/styles'
import Tooltip from '@mui/material/Tooltip'
import { useTranslation } from 'react-i18next'
import DoneOutlinedIcon from '@mui/icons-material/DoneOutlined'
import ReportProblemOutlinedIcon from '@mui/icons-material/ReportProblemOutlined'
import Typography from '@mui/material/Typography'

import LightIcon from '../HealthCheck/LightIcon'

import styles from './styles'

const useStyles = makeStyles(styles)
Expand All @@ -21,19 +20,16 @@ const ProducerHealthIndicators = ({ producer, message }) => {
return (
<div>
{producer.health_status.map((item, index) => (
<Tooltip
key={`health-indicator-${index}`}
title={t(`hs_${item.name}`)}
aria-label="add"
<div
className={classes.wrapper}
key={`health-indicator-${producer?.owner || ''}-${index}`}
>
<div className={classes.wrapper}>
<Typography>{`${t(`hs_${item.name}`)}: ${
item.valid ? t('found') : t('missing')
}`}</Typography>
{item.valid && <DoneOutlinedIcon className="success" />}
{!item.valid && <ReportProblemOutlinedIcon className="warning" />}
</div>
</Tooltip>
<Typography>{`${t(`hs_${item.name}`)}: ${
item.valid ? t('found') : t('missing')
}`}</Typography>
{item.valid && <LightIcon status="greenLight" />}
{!item.valid && <LightIcon status="yellowLight" />}
</div>
))}
</div>
)
Expand Down

0 comments on commit 6f9458f

Please sign in to comment.