Merge: + client: add digit grouping for numbers on the dashboard

Closes #1423

Squashed commit of the following:

commit 6e5de427c48577ebbe4d963f817b66fed9b29bb4
Author: Ildar Kamalov <i.kamalov@adguard.com>
Date:   Wed Mar 11 17:56:39 2020 +0300

    + client: add digit grouping for numbers on the dashboard
This commit is contained in:
Ildar Kamalov
2020-03-17 15:15:19 +03:00
parent bc9bccc669
commit e5db33705d
4 changed files with 41 additions and 12 deletions

View File

@@ -1,18 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
const Cell = props => (
import { formatNumber } from '../../helpers/helpers';
const Cell = ({ value, percent, color }) => (
<div className="stats__row">
<div className="stats__row-value mb-1">
<strong>{props.value}</strong>
<small className="ml-3 text-muted">{props.percent}%</small>
<strong>{formatNumber(value)}</strong>
<small className="ml-3 text-muted">{percent}%</small>
</div>
<div className="progress progress-xs">
<div
className="progress-bar"
style={{
width: `${props.percent}%`,
backgroundColor: props.color,
width: `${percent}%`,
backgroundColor: color,
}}
/>
</div>