Add count attribute to badges (#3405)

This commit is contained in:
CJ 2023-02-07 22:08:38 -06:00 committed by GitHub
parent deb5110623
commit 7761ac19de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -17,7 +17,12 @@ export const Counter: React.FC<IProps> = ({
if (abbreviateCounter) {
const formated = TextUtils.abbreviateCounter(count);
return (
<Badge className="left-spacing" pill variant="secondary">
<Badge
className="left-spacing"
pill
variant="secondary"
data-value={intl.formatNumber(count)}
>
<FormattedNumber
value={formated.size}
maximumFractionDigits={formated.digits}
@ -27,7 +32,12 @@ export const Counter: React.FC<IProps> = ({
);
} else {
return (
<Badge className="left-spacing" pill variant="secondary">
<Badge
className="left-spacing"
pill
variant="secondary"
data-value={intl.formatNumber(count)}
>
{intl.formatNumber(count)}
</Badge>
);