diff --git a/components/charts/project-charts.js b/components/charts/project-charts.js index 6d7833d..e1d99c6 100644 --- a/components/charts/project-charts.js +++ b/components/charts/project-charts.js @@ -51,12 +51,14 @@ const ProjectCharts = () => { ) }, [data]) + const issuedKeys = Object.keys(issued.mapping) + return ( <> { - if (Object.keys(issued.mapping).length > 0) { + if (issuedKeys.length) { setExpanded(!expanded) } }} @@ -64,7 +66,7 @@ const ProjectCharts = () => { '&:hover #expander': { stroke: 'primary', }, - cursor: 'pointer', + cursor: issuedKeys.length ? 'pointer' : null, color: 'primary', fontFamily: 'mono', letterSpacing: 'mono', @@ -77,7 +79,7 @@ const ProjectCharts = () => { label='Credits issued' {...issued} expanded={expanded} - showExpander={Object.keys(issued.mapping).length > 0} + showExpander={issuedKeys.length > 0} />