Skip to content

Commit

Permalink
Hide all legends in small cards
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasPetton committed Jun 24, 2021
1 parent 7816e3a commit 957a1b9
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/components/profitAndLossLegend/profitAndLossLegend.jsx
Expand Up @@ -27,18 +27,12 @@ export default function profitAndLossLegend({
}
`}</style>
<div className="wk-button-group-right" style={buttonGroupStyle}>
{datasets.map((dataset, index) => {
if (isSmall && index > 1) {
return null;
}

return renderLegendItem({
dataset,
index,
onToggleDataset,
includeShowMore
});
})}
{!isSmall && datasets.map((dataset, index) => renderLegendItem({
dataset,
index,
onToggleDataset,
includeShowMore
}))}
{includeShowMore && renderMoreButton({ onTriggerExpandView })}
</div>
</>;
Expand Down Expand Up @@ -69,7 +63,7 @@ function renderMoreButton({ onTriggerExpandView }) {
type="button"
onClick={onTriggerExpandView}
>
More<span aria-hidden="true" className="wk-icon-arrow-right"/>
Show more<span aria-hidden="true" className="wk-icon-arrow-right"/>
</button>
);
}

0 comments on commit 957a1b9

Please sign in to comment.