format follower count

This commit is contained in:
Thomas Zarebczan 2021-08-19 16:09:31 -04:00 committed by GitHub
parent 5208be07ab
commit b9bd164b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,15 +168,17 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
const shouldHideActions = hideActions || isMyCollection || type === 'small' || type === 'tooltip'; const shouldHideActions = hideActions || isMyCollection || type === 'small' || type === 'tooltip';
const canonicalUrl = claim && claim.canonical_url; const canonicalUrl = claim && claim.canonical_url;
const lastCollectionIndex = collectionUris ? collectionUris.length - 1 : 0; const lastCollectionIndex = collectionUris ? collectionUris.length - 1 : 0;
const channelSubscribers = React.useMemo(() => { const channelSubscribers = React.useMemo(() => {
if (channelSubCount === undefined) { if (channelSubCount === undefined) {
return <span />; return <span />;
} }
const formattedSubCount = Number(channelSubCount).toLocaleString();
return ( return (
<span className="claim-preview__channel-sub-count"> <span className="claim-preview__channel-sub-count">
{channelSubCount === 1 {channelSubCount === 1
? __('%channelSubCount% Follower', { channelSubCount }) ? __('%channelSubCount% Follower', { formattedSubCount })
: __('%channelSubCount% Followers', { channelSubCount })} : __('%channelSubCount% Followers', { formattedSubCount })}
</span> </span>
); );
}, [channelSubCount]); }, [channelSubCount]);