From ff10316c124049ef1fa396ac05a7f7d7ff6a72e3 Mon Sep 17 00:00:00 2001 From: Shane Loeffler Date: Thu, 4 Jan 2024 15:07:48 -0600 Subject: [PATCH] cursor styling when no expansion possible --- components/charts/project-charts.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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} />