Skip to content

Commit

Permalink
Add interpunct between types in list (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbazant authored Nov 14, 2024
1 parent 1193f02 commit ade9a3f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/list/Locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ import { ReactComponent as LeafIcon } from './leaf.svg'

const TypeNameTagWrapper = styled.span`
display: inline-block;
margin-right: 1em;
margin-bottom: 0.5em;
opacity: ${({ isSelected }) => (isSelected ? 1 : 0.5)};
font-size: 0.875rem;
&:not(:nth-last-child(2))::after {
content: '·';
margin: 0 0.5em;
color: ${({ theme }) => theme.secondaryText};
}
`
const CommonName = styled.span`
font-weight: bold;
Expand All @@ -25,16 +30,12 @@ const ScientificName = styled.span`
color: ${({ theme }) => theme.secondaryText};
`

const TypeNameWrapper = styled.div`
font-size: 0.875rem;
`

const TypeName = ({ commonName, scientificName }) => (
<TypeNameWrapper>
<span>
{commonName && <CommonName>{commonName}</CommonName>}
{commonName && scientificName && <span style={{ margin: '0 0.25em' }} />}
{scientificName && <ScientificName>{scientificName}</ScientificName>}
</TypeNameWrapper>
</span>
)

const LocationItem = styled.li`
Expand Down

0 comments on commit ade9a3f

Please sign in to comment.