fix: don't pluralize Filter Button with 1 result (#5139)

* don't pluralize results with 1 result

* pass in count for profile page
This commit is contained in:
Charles Bachmeier 2022-11-09 11:15:34 -05:00 committed by GitHub
parent 1d849927ef
commit 02aeb43e62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

@ -4,7 +4,7 @@ import * as styles from 'nft/components/collection/FilterButton.css'
import { FilterIcon } from 'nft/components/icons'
import { buttonTextMedium } from 'nft/css/common.css'
import { useIsCollectionLoading } from 'nft/hooks'
import { putCommas } from 'nft/utils'
import { pluralize, putCommas } from 'nft/utils'
export const FilterButton = ({
onClick,
@ -42,7 +42,12 @@ export const FilterButton = ({
<FilterIcon />
{!isMobile ? (
<>
{!isFiltersExpanded && <Box className={buttonTextMedium}> Filter {putCommas(collectionCount)} results</Box>}
{!isFiltersExpanded && (
<Box className={buttonTextMedium}>
{' '}
Filter {putCommas(collectionCount)} result{pluralize(collectionCount)}
</Box>
)}
</>
) : null}
</Box>

@ -170,6 +170,7 @@ export const ProfilePage = () => {
<FilterButton
isMobile={isMobile}
isFiltersExpanded={isFiltersExpanded}
collectionCount={ownerAssets?.length}
onClick={() => setFiltersExpanded(!isFiltersExpanded)}
/>
<Row gap="8" flexWrap="nowrap">