Fix subscribers counter on WebUI
This commit is contained in:
parent
8e45e9bb82
commit
736864287d
2 changed files with 16 additions and 1 deletions
|
@ -57,6 +57,18 @@ export function counterRenderer(counterType, isBold = true) {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
case 'subscribers': {
|
||||||
|
return (displayNumber, pluralReady) => (
|
||||||
|
<FormattedMessage
|
||||||
|
id='account.subscribers_counter'
|
||||||
|
defaultMessage='{count, plural, one {{counter} Subscriber} other {{counter} Subscribers}}'
|
||||||
|
values={{
|
||||||
|
count: pluralReady,
|
||||||
|
counter: renderCounter(displayNumber),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
default: throw Error(`Incorrect counter name: ${counterType}. Ensure it accepted by commonCounter function`);
|
default: throw Error(`Incorrect counter name: ${counterType}. Ensure it accepted by commonCounter function`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -403,7 +403,10 @@ class Header extends ImmutablePureComponent {
|
||||||
|
|
||||||
{ (me === account.get('id')) && (
|
{ (me === account.get('id')) && (
|
||||||
<NavLink exact activeClassName='active' to={`/accounts/${account.get('id')}/subscribing`} title={intl.formatNumber(account.get('subscribing_count'))}>
|
<NavLink exact activeClassName='active' to={`/accounts/${account.get('id')}/subscribing`} title={intl.formatNumber(account.get('subscribing_count'))}>
|
||||||
<strong>{shortNumberFormat(account.get('subscribing_count'))}</strong> <FormattedMessage id='account.subscribes' defaultMessage='Subscribes' />
|
<ShortNumber
|
||||||
|
value={account.get('subscribing_count')}
|
||||||
|
renderer={counterRenderer('subscribers')}
|
||||||
|
/>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue