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:
parent
1d849927ef
commit
02aeb43e62
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user