Skip to content

Commit

Permalink
feat(hapi&webapp): show only one icon when bpjson is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Torresmorah committed Nov 3, 2022
1 parent 6f9458f commit 0ef416d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions hapi/src/services/eosio.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ const getProducerHealthStatus = bpJson => {
name: 'bpJson',
valid: !!bpJson && !!Object.keys(bpJson).length
})

if (!healthStatus[0].valid) return healthStatus

healthStatus.push({
name: 'organization_name',
valid: !!bpJson.org?.candidate_name
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/InformationCard/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default (theme) => ({
color: theme.palette.warning.main,
},
[theme.breakpoints.up('lg')]: {
minWidth: 150,
minWidth: 130,
},
},
social: {
Expand Down
8 changes: 3 additions & 5 deletions webapp/src/components/ProducerHealthIndicators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ const ProducerHealthIndicators = ({ producer, message }) => {
if (!producer.health_status.length) return <Typography>{message}</Typography>

return (
<div>
<>
{producer.health_status.map((item, index) => (
<div
className={classes.wrapper}
key={`health-indicator-${producer?.owner || ''}-${index}`}
>
<Typography>{`${t(`hs_${item.name}`)}: ${
item.valid ? t('found') : t('missing')
}`}</Typography>
<Typography>{`${t(`hs_${item.name}`)}`}</Typography>
{item.valid && <LightIcon status="greenLight" />}
{!item.valid && <LightIcon status="yellowLight" />}
</div>
))}
</div>
</>
)
}

Expand Down
5 changes: 3 additions & 2 deletions webapp/src/components/ProducerHealthIndicators/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default () => ({
wrapper: {
display: 'flex',
alignItems: 'center'
}
alignItems: 'center',
justifyContent: 'space-between',
},
})

0 comments on commit 0ef416d

Please sign in to comment.