Skip to content

Commit

Permalink
cursor styling when no expansion possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane98c committed Jan 4, 2024
1 parent 4a4ce4b commit ff10316
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/charts/project-charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,22 @@ const ProjectCharts = () => {
)
}, [data])

const issuedKeys = Object.keys(issued.mapping)

return (
<>
<Row
columns={[6, 8, 8, 8]}
onClick={() => {
if (Object.keys(issued.mapping).length > 0) {
if (issuedKeys.length) {
setExpanded(!expanded)
}
}}
sx={{
'&:hover #expander': {
stroke: 'primary',
},
cursor: 'pointer',
cursor: issuedKeys.length ? 'pointer' : null,
color: 'primary',
fontFamily: 'mono',
letterSpacing: 'mono',
Expand All @@ -77,7 +79,7 @@ const ProjectCharts = () => {
label='Credits issued'
{...issued}
expanded={expanded}
showExpander={Object.keys(issued.mapping).length > 0}
showExpander={issuedKeys.length > 0}
/>
</Column>
<Column start={[1, 5, 5, 5]} width={[6, 4, 4, 4]}>
Expand Down

0 comments on commit ff10316

Please sign in to comment.