mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Added user button and menu.
This commit is contained in:
parent
a5930f1772
commit
6e23a8a53b
21 changed files with 268 additions and 83 deletions
18
pages/account.js
Normal file
18
pages/account.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import Account from 'components/Account';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
export default function AccountPage() {
|
||||
const { loading } = useRequireLogin();
|
||||
|
||||
if (loading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Account />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
18
pages/dashboard.js
Normal file
18
pages/dashboard.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import WebsiteList from 'components/WebsiteList';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
export default function DashboardPage() {
|
||||
const { loading } = useRequireLogin();
|
||||
|
||||
if (loading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<WebsiteList />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,18 +1,12 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import WebsiteList from 'components/WebsiteList';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function HomePage() {
|
||||
const { loading } = useRequireLogin();
|
||||
export default function DefaultPage() {
|
||||
const router = useRouter();
|
||||
|
||||
if (loading) {
|
||||
return null;
|
||||
}
|
||||
useEffect(() => {
|
||||
router.push('/dashboard');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<WebsiteList />
|
||||
</Layout>
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue