Merge branch 'master' into dev
Some checks are pending
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run

# Conflicts:
#	src/components/common/PageHeader.tsx
#	src/components/metrics/ActiveUsers.tsx
This commit is contained in:
Mike Cao 2025-12-03 00:17:44 -08:00
commit 41d2a24f9d
55 changed files with 85 additions and 12 deletions

View file

@ -1,5 +1,6 @@
import { Column, Grid, Heading, Icon, Row, Text } from '@umami/react-zen';
import type { ReactNode } from 'react';
import { LinkButton } from './LinkButton';
export function PageHeader({
title,
@ -7,6 +8,7 @@ export function PageHeader({
label,
icon,
showBorder = true,
titleHref,
children,
}: {
title: string;
@ -14,6 +16,7 @@ export function PageHeader({
label?: ReactNode;
icon?: ReactNode;
showBorder?: boolean;
titleHref?: string;
allowEdit?: boolean;
className?: string;
children?: ReactNode;
@ -33,7 +36,13 @@ export function PageHeader({
{icon}
</Icon>
)}
{title && <Heading size={{ xs: '2', md: '3', lg: '4' }}>{title}</Heading>}
{title && titleHref ? (
<LinkButton href={titleHref} variant="quiet">
<Heading size={{ xs: '2', md: '3', lg: '4' }}>{title}</Heading>
</LinkButton>
) : (
title && <Heading size={{ xs: '2', md: '3', lg: '4' }}>{title}</Heading>
)}
</Row>
{description && (
<Text color="muted" truncate style={{ maxWidth: 600 }} title={description}>

View file

@ -1,5 +1,6 @@
import { StatusLight, Text } from '@umami/react-zen';
import { useMemo } from 'react';
import { LinkButton } from '@/components/common/LinkButton';
import { useActyiveUsersQuery, useMessages } from '@/components/hooks';
export function ActiveUsers({
@ -27,10 +28,12 @@ export function ActiveUsers({
}
return (
<StatusLight variant="success">
<Text size="2" weight="medium">
{count} {formatMessage(labels.online)}
</Text>
</StatusLight>
<LinkButton href={`/websites/${websiteId}/realtime`} variant="quiet">
<StatusLight variant="success">
<Text size="2" weight="medium">
{count} {formatMessage(labels.online)}
</Text>
</StatusLight>
</LinkButton>
);
}