mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Moved files around. Updated test page.
This commit is contained in:
parent
890b209527
commit
6bb34cd3a5
19 changed files with 136 additions and 69 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteList from 'components/WebsiteList';
|
||||
import WebsiteList from 'components/pages/WebsiteList';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
export default function DashboardPage() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import Settings from 'components/settings/Settings';
|
||||
import Settings from 'components/pages/Settings';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
export default function SettingsPage() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteDetails from 'components/WebsiteDetails';
|
||||
import WebsiteDetails from 'components/pages/WebsiteDetails';
|
||||
import useFetch from 'hooks/useFetch';
|
||||
|
||||
export default function SharePage() {
|
||||
|
|
|
|||
|
|
@ -1,56 +1,18 @@
|
|||
import Head from 'next/head';
|
||||
import Link from 'next/link';
|
||||
import { useRouter } from 'next/router';
|
||||
import React from 'react';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import Test from 'components/pages/Test';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
export default function Test() {
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
export default function TestPage() {
|
||||
const { loading } = useRequireLogin();
|
||||
|
||||
if (!id) {
|
||||
return <h1>No id query specified.</h1>;
|
||||
}
|
||||
|
||||
function handleClick() {
|
||||
window.umami('Custom event');
|
||||
window.umami.pageView('/fake', 'https://www.google.com');
|
||||
window.umami.pageEvent('pageEvent', 'custom-type');
|
||||
if (loading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
{typeof window !== 'undefined' && (
|
||||
<script async defer data-website-id={id} src="/umami.js" />
|
||||
)}
|
||||
</Head>
|
||||
<Layout>
|
||||
<p>
|
||||
Here you can test if your umami installation works. Open the network tab in your browser
|
||||
developer console and watch for requests to the url <b>collect</b>. The links below should
|
||||
trigger page views. Clicking on the button should trigger an event.
|
||||
</p>
|
||||
<h2>Page links</h2>
|
||||
<Link href={`?id=${id}&q=1`}>
|
||||
<a>Page One</a>
|
||||
</Link>
|
||||
<br />
|
||||
<Link href={`?id=${id}&q=2`}>
|
||||
<a>Page Two</a>
|
||||
</Link>
|
||||
<h2>Events</h2>
|
||||
<button
|
||||
id="primary-button"
|
||||
className="otherClass umami--click--primary-button align-self-start"
|
||||
type="button"
|
||||
>
|
||||
Button
|
||||
</button>
|
||||
<h2>Manual trigger</h2>
|
||||
<button id="manual-button" type="button" onClick={handleClick}>
|
||||
Button
|
||||
</button>
|
||||
</Layout>
|
||||
</>
|
||||
<Layout>
|
||||
<Test />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteDetails from 'components/WebsiteDetails';
|
||||
import WebsiteDetails from 'components/pages/WebsiteDetails';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
export default function DetailsPage() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue