mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Refactor components and styles.
This commit is contained in:
parent
c5599f1e20
commit
a2db27894f
16 changed files with 189 additions and 184 deletions
|
|
@ -6,7 +6,7 @@ export default async (req, res) => {
|
|||
|
||||
const { id } = req.query;
|
||||
|
||||
const website = await getWebsite(id);
|
||||
const website = await getWebsite({ website_id: +id });
|
||||
|
||||
return res.status(200).json(website);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,26 +1,13 @@
|
|||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { parse } from 'cookie';
|
||||
import Layout from 'components/Layout';
|
||||
import PageviewsChart from 'components/PageviewsChart';
|
||||
import { verifySecureToken } from 'lib/crypto';
|
||||
import { subDays, endOfDay } from 'date-fns';
|
||||
import WebsiteList from '../components/WebsiteList';
|
||||
|
||||
export default function HomePage({ username }) {
|
||||
return (
|
||||
<Layout>
|
||||
<WebsiteList />
|
||||
<div>
|
||||
<PageviewsChart
|
||||
websiteId={3}
|
||||
startDate={subDays(endOfDay(new Date()), 6)}
|
||||
endDate={endOfDay(new Date())}
|
||||
/>
|
||||
</div>
|
||||
<Link href="/logout">
|
||||
<a>Logout 🡒</a>
|
||||
</Link>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,19 @@
|
|||
import React from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Layout from 'components/Layout';
|
||||
import WebsiteDetails from '../components/WebsiteDetails';
|
||||
import WebsiteDetails from '../../components/WebsiteDetails';
|
||||
|
||||
export default function DetailsPage() {
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<WebsiteDetails websiteId={id} />
|
||||
<WebsiteDetails websiteId={+id[0]} />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue