Added metrics bar and date range to sessions.

This commit is contained in:
Mike Cao 2024-08-07 00:10:25 -07:00
parent 36663bd52d
commit b9068c0050
44 changed files with 859 additions and 739 deletions

View file

@ -2,7 +2,7 @@ import { useMemo } from 'react';
import { colord } from 'colord';
import BarChart from 'components/charts/BarChart';
import { getDateArray } from 'lib/date';
import { useLocale, useDateRange, useWebsiteEvents } from 'components/hooks';
import { useLocale, useDateRange, useWebsiteEventsSeries } from 'components/hooks';
import { CHART_COLORS } from 'lib/constants';
import { renderDateLabels } from 'lib/charts';
@ -16,7 +16,7 @@ export function EventsChart({ websiteId, className }: EventsChartProps) {
dateRange: { startDate, endDate, unit },
} = useDateRange(websiteId);
const { locale } = useLocale();
const { data, isLoading } = useWebsiteEvents(websiteId);
const { data, isLoading } = useWebsiteEventsSeries(websiteId);
const chartData = useMemo(() => {
if (!data) return [];

View file

@ -10,7 +10,7 @@ export interface MetricCardProps {
change?: number;
label?: string;
reverseColors?: boolean;
formatValue?: typeof formatNumber;
formatValue?: (n: any) => string;
showLabel?: boolean;
showChange?: boolean;
showPrevious?: boolean;

View file

@ -25,7 +25,7 @@ export function PagesTable({ allowFilter, ...props }: PagesTableProps) {
const buttons = [
{
label: 'URL',
label: formatMessage(labels.path),
key: 'url',
},
{