mirror of
https://github.com/umami-software/umami.git
synced 2026-02-22 05:25:36 +01:00
Pixel/link metrics pages.
This commit is contained in:
parent
789b8b36d8
commit
8e766e2db7
42 changed files with 530 additions and 49 deletions
45
src/app/(main)/websites/[websiteId]/WebsitePage.tsx
Normal file
45
src/app/(main)/websites/[websiteId]/WebsitePage.tsx
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
'use client';
|
||||
import { Column, Modal, Dialog } from '@umami/react-zen';
|
||||
import { useNavigation } from '@/components/hooks';
|
||||
import { Panel } from '@/components/common/Panel';
|
||||
import { WebsiteChart } from './WebsiteChart';
|
||||
import { WebsiteExpandedView } from './WebsiteExpandedView';
|
||||
import { WebsiteMetricsBar } from './WebsiteMetricsBar';
|
||||
import { WebsiteTableView } from './WebsiteTableView';
|
||||
import { WebsiteControls } from './WebsiteControls';
|
||||
|
||||
export function WebsitePage({ websiteId }: { websiteId: string }) {
|
||||
const {
|
||||
router,
|
||||
query: { view, compare },
|
||||
updateParams,
|
||||
} = useNavigation();
|
||||
const handleClose = (close: () => void) => {
|
||||
router.push(updateParams({ view: undefined }));
|
||||
close();
|
||||
};
|
||||
|
||||
const handleOpenChange = (isOpen: boolean) => {
|
||||
if (!isOpen) {
|
||||
router.push(updateParams({ view: undefined }));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Column gap>
|
||||
<WebsiteControls websiteId={websiteId} allowCompare={true} />
|
||||
<WebsiteMetricsBar websiteId={websiteId} showChange={true} />
|
||||
<Panel>
|
||||
<WebsiteChart websiteId={websiteId} compareMode={compare} />
|
||||
</Panel>
|
||||
<WebsiteTableView websiteId={websiteId} />
|
||||
<Modal isOpen={!!view} onOpenChange={handleOpenChange} isDismissable>
|
||||
<Dialog style={{ maxWidth: 1320, width: '100vw', height: 'calc(100vh - 40px)' }}>
|
||||
{({ close }) => {
|
||||
return <WebsiteExpandedView websiteId={websiteId} onClose={() => handleClose(close)} />;
|
||||
}}
|
||||
</Dialog>
|
||||
</Modal>
|
||||
</Column>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue