mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 09:05:36 +01:00
Updated login and layout pages.
This commit is contained in:
parent
9d967fb0fe
commit
4f15c4f146
18 changed files with 103 additions and 106 deletions
|
|
@ -1,23 +1,23 @@
|
|||
import Layout from 'components/layout/Layout';
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import Menu from 'components/nav/Nav';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import styles from './SettingsLayout.module.css';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
|
||||
export default function SettingsLayout({ children }) {
|
||||
const { user } = useRequireLogin();
|
||||
const { adminDisabled } = useConfig();
|
||||
|
||||
if (!user) {
|
||||
if (adminDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<AppLayout>
|
||||
<div className={styles.dashboard}>
|
||||
<div className={styles.nav}>
|
||||
<Menu />
|
||||
</div>
|
||||
<div className={styles.content}>{children}</div>
|
||||
</div>
|
||||
</Layout>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,10 @@ export default function WebsitesList() {
|
|||
const [edit, setEdit] = useState(false);
|
||||
const { get, useQuery } = useApi();
|
||||
const { user } = useUser();
|
||||
const { data, isLoading, error, refetch } = useQuery(['websites', user.id], () =>
|
||||
get(`/users/${user.id}/websites`),
|
||||
const { data, isLoading, error, refetch } = useQuery(
|
||||
['websites', user?.id],
|
||||
() => get(`/users/${user?.id}/websites`),
|
||||
{ enabled: !!user },
|
||||
);
|
||||
const hasData = data && data.length !== 0;
|
||||
const { toast, showToast } = useToast();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue