Skip to content

Commit

Permalink
Hide locality filter dropdown if there are no dropdown options
Browse files Browse the repository at this point in the history
  • Loading branch information
terryttsai committed Jul 19, 2022
1 parent 230237b commit fe59897
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ const LocalityFilterSelect: React.FC<LocalityFilterSelectProps> = ({
metric.localityId = newFilter;
});

// if there are no locality entries, don't display the dropdown. We are skipping this for Idaho launch. See https://github.com/Recidiviz/public-dashboard/issues/582
if (metric.localityLabels.entries.length === 0) {
return null;
}

return (
<Dropdown
label={metric.localityLabels.label}
Expand Down
4 changes: 4 additions & 0 deletions spotlight-client/src/VizControls/VizControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const FilterWrapper = styled.div`
&:last-child {
margin-right: 0;
}
&:empty {
margin-right: 0;
}
`;

const Button = styled.button`
Expand Down

0 comments on commit fe59897

Please sign in to comment.