From 4f15c4f1466a236b5280e5749abf664ad4fb086c Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 11 Jan 2023 14:47:38 -0800 Subject: [PATCH] Updated login and layout pages. --- components/layout/{Layout.js => AppLayout.js} | 8 ++-- ...Layout.module.css => AppLayout.module.css} | 0 components/pages/dashboard/Dashboard.js | 8 ++-- components/pages/login/LoginForm.js | 21 +++++----- components/pages/login/LoginForm.module.css | 38 +++++++++++-------- components/pages/login/LoginLayout.js | 16 ++++++++ components/pages/login/LoginLayout.module.css | 7 ++++ components/pages/settings/SettingsLayout.js | 12 +++--- .../pages/settings/websites/WebsitesList.js | 6 ++- hooks/useLocale.js | 8 ++-- pages/404.js | 6 +-- pages/console/[[...id]].js | 10 ++--- pages/dashboard/[[...id]].js | 25 ++---------- pages/login.js | 6 +-- pages/realtime.js | 13 ++----- pages/settings/websites/index.js | 9 ----- pages/share/[...id].js | 6 +-- pages/websites/[id]/index.js | 10 ++--- 18 files changed, 103 insertions(+), 106 deletions(-) rename components/layout/{Layout.js => AppLayout.js} (73%) rename components/layout/{Layout.module.css => AppLayout.module.css} (100%) create mode 100644 components/pages/login/LoginLayout.js create mode 100644 components/pages/login/LoginLayout.module.css diff --git a/components/layout/Layout.js b/components/layout/AppLayout.js similarity index 73% rename from components/layout/Layout.js rename to components/layout/AppLayout.js index f1c31bb0..7c59b007 100644 --- a/components/layout/Layout.js +++ b/components/layout/AppLayout.js @@ -3,8 +3,10 @@ import Head from 'next/head'; import Header from 'components/layout/Header'; import Footer from 'components/layout/Footer'; import useLocale from 'hooks/useLocale'; +import useRequireLogin from 'hooks/useRequireLogin'; -export default function Layout({ title, children, header = true, footer = true }) { +export default function AppLayout({ title, children }) { + useRequireLogin(); const { dir } = useLocale(); return ( @@ -12,9 +14,9 @@ export default function Layout({ title, children, header = true, footer = true } {title ? `${title} | umami` : 'umami'} - {header &&
} +
{children}
- {footer &&