chore: remove stats page, rename reports
This commit is contained in:
parent
eccd7b5d96
commit
130698a317
18
app/root.tsx
18
app/root.tsx
|
|
@ -285,11 +285,11 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
|||
/>
|
||||
<NavLink
|
||||
component={Link}
|
||||
to="/report"
|
||||
label="Report"
|
||||
to="/reports"
|
||||
label="Reports"
|
||||
icon={
|
||||
<ThemeIcon variant="light">
|
||||
<FileText size={16} />
|
||||
<BarChart2 size={16} />
|
||||
</ThemeIcon>
|
||||
}
|
||||
variant="light"
|
||||
|
|
@ -307,18 +307,6 @@ function Layout({ children }: React.PropsWithChildren<{}>) {
|
|||
variant="light"
|
||||
active={location.pathname.includes('/importexport')}
|
||||
/>
|
||||
<NavLink
|
||||
component={Link}
|
||||
to="/statistics"
|
||||
label="Statistics"
|
||||
icon={
|
||||
<ThemeIcon variant="light">
|
||||
<BarChart2 size={16} />
|
||||
</ThemeIcon>
|
||||
}
|
||||
variant="light"
|
||||
active={location.pathname.includes('/statistics')}
|
||||
/>
|
||||
</Navbar.Section>
|
||||
)}
|
||||
{user && (
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import { requireUserId } from '~/session.server';
|
|||
|
||||
export const meta: MetaFunction = () => {
|
||||
return {
|
||||
title: 'Report | WorkTimer',
|
||||
title: 'Reports | WorkTimer',
|
||||
description:
|
||||
'Generate a report of your time entries. You must be logged in to do this.'
|
||||
'Generate reports of your time entries. You must be logged in to do this.'
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ export default function ReportPage() {
|
|||
border: 0
|
||||
}}
|
||||
>
|
||||
Report
|
||||
Reports
|
||||
</h1>
|
||||
<Paper p="lg" radius="md">
|
||||
Coming soon
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
import { Box, Paper } from '@mantine/core';
|
||||
import { MetaFunction, LoaderArgs, redirect, json } from '@remix-run/node';
|
||||
import { useLoaderData } from '@remix-run/react';
|
||||
import { getTimeEntries } from '~/models/timeEntry.server';
|
||||
import { requireUserId } from '~/session.server';
|
||||
|
||||
export const meta: MetaFunction = () => {
|
||||
return {
|
||||
title: 'Statistics | WorkTimer',
|
||||
description:
|
||||
'See statistics about your time entries. You must be logged in to do this.'
|
||||
};
|
||||
};
|
||||
|
||||
export async function loader({ request }: LoaderArgs) {
|
||||
const userId = await requireUserId(request);
|
||||
if (!userId) return redirect('/login');
|
||||
|
||||
return json({
|
||||
...(await getTimeEntries({
|
||||
userId
|
||||
}))
|
||||
});
|
||||
}
|
||||
|
||||
export default function ReportPage() {
|
||||
const data = useLoaderData();
|
||||
|
||||
return (
|
||||
<>
|
||||
<h1>Statistics</h1>
|
||||
<Paper p="lg" radius="md">
|
||||
Coming soon
|
||||
</Paper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue