diff --git a/components/messages.js b/components/messages.js index c09fcad3..efb267d5 100644 --- a/components/messages.js +++ b/components/messages.js @@ -105,6 +105,10 @@ export const labels = defineMessages({ uniqueVisitors: { id: 'label.unique-visitors', defaultMessage: 'Unique visitors' }, bounceRate: { id: 'label.bounce-rate', defaultMessage: 'Bounce rate' }, averageVisitTime: { id: 'label.average-visit-time', defaultMessage: 'Average visit time' }, + desktop: { id: 'label.desktop', defaultMessage: 'Desktop' }, + laptop: { id: 'label.laptop', defaultMessage: 'Laptop' }, + tablet: { id: 'label.tablet', defaultMessage: 'Tablet' }, + mobile: { id: 'label.mobile', defaultMessage: 'Mobile' }, }); export const messages = defineMessages({ diff --git a/components/metrics/DataTable.js b/components/metrics/DataTable.js index 76272808..ceb7ea9c 100644 --- a/components/metrics/DataTable.js +++ b/components/metrics/DataTable.js @@ -90,16 +90,13 @@ const AnimatedRow = ({
{label}
- {props.y?.interpolate(format)} + {props.y?.to(format)}
{showPercentage && (
- `${n}%`) }} - /> + `${n}%`) }} /> - {props.width.interpolate(n => `${n.toFixed(0)}%`)} + {props.width.to(n => `${n.toFixed(0)}%`)}
)} diff --git a/components/metrics/DevicesTable.js b/components/metrics/DevicesTable.js index 7c58699a..997d25cc 100644 --- a/components/metrics/DevicesTable.js +++ b/components/metrics/DevicesTable.js @@ -1,23 +1,27 @@ import MetricsTable from './MetricsTable'; -import { useIntl, FormattedMessage } from 'react-intl'; -import { getDeviceMessage } from 'components/messages'; +import { useIntl } from 'react-intl'; import FilterLink from 'components/common/FilterLink'; +import { labels } from 'components/messages'; export default function DevicesTable({ websiteId, ...props }) { const { formatMessage } = useIntl(); function renderLink({ x: device }) { return ( - + ); } return ( } + title={formatMessage(labels.devices)} type="device" - metric={} + metric={formatMessage(labels.visitors)} websiteId={websiteId} renderLabel={renderLink} /> diff --git a/components/metrics/MetricCard.js b/components/metrics/MetricCard.js index aaf9054d..a846cd2b 100644 --- a/components/metrics/MetricCard.js +++ b/components/metrics/MetricCard.js @@ -15,7 +15,7 @@ const MetricCard = ({ return (
- {props.x.interpolate(x => format(x))} + {props.x.to(x => format(x))}
{label} {~~change !== 0 && !hideComparison && ( @@ -30,7 +30,7 @@ const MetricCard = ({ : styles.positive } ${change >= 0 ? styles.plusSign : ''}`} > - {changeProps.x.interpolate(x => format(x))} + {changeProps.x.to(x => format(x))} )}
diff --git a/components/metrics/MetricCard.module.css b/components/metrics/MetricCard.module.css index 520c2b01..78505321 100644 --- a/components/metrics/MetricCard.module.css +++ b/components/metrics/MetricCard.module.css @@ -19,7 +19,7 @@ display: flex; align-items: center; font-weight: 700; - gap: 5px; + gap: 10px; white-space: nowrap; min-height: 30px; } @@ -28,17 +28,17 @@ font-size: 12px; padding: 0 5px; border-radius: 5px; - margin-left: 4px; - border: 1px solid var(--base200); color: var(--base500); } .change.positive { - color: var(--green500); + color: var(--green700); + background: var(--green100); } .change.negative { - color: var(--red500); + color: var(--red700); + background: var(--red100); } .change.plusSign::before {