mirror of
https://github.com/umami-software/umami.git
synced 2026-02-22 13:35:35 +01:00
New compare page.
This commit is contained in:
parent
08f9adaddf
commit
3f167e05ba
17 changed files with 151 additions and 127 deletions
|
|
@ -13,6 +13,7 @@ import {
|
|||
Network,
|
||||
ChartPie,
|
||||
UserPlus,
|
||||
Compare,
|
||||
} from '@/components/icons';
|
||||
import { useMessages, useNavigation } from '@/components/hooks';
|
||||
import { SideMenu } from '@/components/common/SideMenu';
|
||||
|
|
@ -22,7 +23,8 @@ export function WebsiteNav({ websiteId }: { websiteId: string }) {
|
|||
const { formatMessage, labels } = useMessages();
|
||||
const { pathname, renderUrl, teamId } = useNavigation();
|
||||
|
||||
const renderPath = (path: string) => renderUrl(`/websites/${websiteId}${path}`);
|
||||
const renderPath = (path: string) =>
|
||||
renderUrl(`/websites/${websiteId}${path}`, { event: undefined });
|
||||
|
||||
const items = [
|
||||
{
|
||||
|
|
@ -52,6 +54,12 @@ export function WebsiteNav({ websiteId }: { websiteId: string }) {
|
|||
icon: <Clock />,
|
||||
path: renderPath('/realtime'),
|
||||
},
|
||||
{
|
||||
id: 'compare',
|
||||
label: formatMessage(labels.compare),
|
||||
icon: <Compare />,
|
||||
path: renderPath('/compare'),
|
||||
},
|
||||
{
|
||||
id: 'breakdown',
|
||||
label: formatMessage(labels.breakdown),
|
||||
|
|
@ -132,8 +140,8 @@ export function WebsiteNav({ websiteId }: { websiteId: string }) {
|
|||
];
|
||||
|
||||
const selectedKey =
|
||||
items.flatMap(e => e.items).find(({ path }) => path && pathname.endsWith(path))?.id ||
|
||||
'overview';
|
||||
items.flatMap(e => e.items).find(({ path }) => path && pathname.endsWith(path.split('?')[0]))
|
||||
?.id || 'overview';
|
||||
|
||||
return (
|
||||
<SideMenu items={items} selectedKey={selectedKey} allowMinimize={false}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue