mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Added report context. Removed report store.
This commit is contained in:
parent
bc37f5124e
commit
bfb52eb678
31 changed files with 372 additions and 273 deletions
20
pages/reports/[id].js
Normal file
20
pages/reports/[id].js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { useRouter } from 'next/router';
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import FunnelReport from 'components/pages/reports/funnel/FunnelReport';
|
||||
import useMessages from 'hooks/useMessages';
|
||||
|
||||
export default function ReportsPage() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout title={formatMessage(labels.websites)}>
|
||||
<FunnelReport reportId={id} />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,13 +1,21 @@
|
|||
import { useState } from 'react';
|
||||
import { Item, Tabs } from 'react-basics';
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import ReportList from 'components/pages/reports/ReportList';
|
||||
import useMessages from 'hooks/useMessages';
|
||||
|
||||
export default function ReportsPage() {
|
||||
const [tab, setTab] = useState('create');
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<AppLayout title={formatMessage(labels.reports)}>
|
||||
<ReportList />
|
||||
<Tabs selectedKey={tab} onSelect={setTab} style={{ marginBottom: 30, fontSize: 14 }}>
|
||||
<Item key="create">{formatMessage(labels.reports)}</Item>
|
||||
<Item key="saved">{formatMessage(labels.save)}</Item>
|
||||
</Tabs>
|
||||
{tab === 'create' && <ReportList />}
|
||||
{tab === 'saved' && <h1>My reports</h1>}
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue