Skip to content

Commit

Permalink
Fix rendering of types in tree (#544)
Browse files Browse the repository at this point in the history
* Remove extra margin present if only scientific name present
* Also grey scientific name when disabled
  • Loading branch information
wbazant authored Oct 31, 2024
1 parent 76c578c commit 9f6acc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/filter/TreeSelectView.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const CommonName = styled.span`
const ScientificName = styled.span`
font-style: italic;
margin-right: 0.5em;
opacity: ${({ isDisabled }) => (isDisabled ? 0.7 : 1)};
color: ${({ theme }) => theme.text};
`

Expand Down Expand Up @@ -146,9 +147,13 @@ const TreeSelectView = ({
/>
</ControlsContainer>
<NodeContent>
<CommonName isDisabled={isDisabled}>{node.commonName}</CommonName>
{node.commonName && (
<CommonName isDisabled={isDisabled}>{node.commonName}</CommonName>
)}
{node.scientificName && (
<ScientificName>{node.scientificName}</ScientificName>
<ScientificName isDisabled={isDisabled}>
{node.scientificName}
</ScientificName>
)}
<Count>({node.count})</Count>
</NodeContent>
Expand Down

0 comments on commit 9f6acc5

Please sign in to comment.