Added Logout Option and prefetch for the dashboard

This commit is contained in:
2023-10-23 00:45:13 -07:00
parent c3dea8ae95
commit de57daf98a
6 changed files with 95 additions and 85 deletions
+5 -6
View File
@@ -20,14 +20,11 @@ const Layout = ({ children }) => {
useEffect(() => {
const authenticationPages = [
// "/",
"/auth",
"/auth/login",
"/auth/sign-up",
"/auth/forgot-password",
"/auth/lock-screen",
"/auth/confirm-mail",
"/auth/logout",
];
setIsAuthenticationPage(authenticationPages.includes(router.pathname));
@@ -38,8 +35,8 @@ const Layout = ({ children }) => {
const title = isAuthenticationPage ? "CMC - auth" : "CMC - dashboard";
const mainWrapper = {
paddingLeft: typeof window !== "undefined" && isAuthenticationPage && "0"
}
paddingLeft: typeof window !== "undefined" && isAuthenticationPage && "0",
};
return (
<>
@@ -65,7 +62,9 @@ const Layout = ({ children }) => {
{children}
</div>
{!isAuthenticationPage && <Footer />}
{!isAuthenticationPage && router.pathname !== "/auth/logout" && (
<Footer />
)}
</div>
<ScrollToTop />