From e170ddca97bdc1c0059ae49180dffb4db3b6f604 Mon Sep 17 00:00:00 2001 From: Ebube Date: Wed, 18 Oct 2023 01:42:13 +0100 Subject: [PATCH 1/3] added docker comment --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8940cf1..daef5b2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -96,7 +96,7 @@ RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \ && yarn --version COPY docker-entrypoint.sh /usr/local/bin/ -ENTRYPOINT ["docker-entrypoint.sh"] +# ENTRYPOINT ["docker-entrypoint.sh"] # COPY docker-entrypoint.sh /usr/local/bin/ # ENTRYPOINT ["docker-entrypoint.sh"] From bc5f8e8db59ed2277e1a41acc0ea3041517661b2 Mon Sep 17 00:00:00 2001 From: Chief Bube Date: Wed, 18 Oct 2023 00:42:34 -0700 Subject: [PATCH 2/3] shortened the url of the auth, fixed sidebar toggle issue and fixed browser tab --- components/_App/Layout.js | 56 +++++++++++-------- components/_App/LeftSidebar/index.js | 7 ++- components/_App/TopNavbar/index.js | 4 +- middlewares/AuthRoute.js | 2 +- pages/_app.js | 28 +++++----- .../{authentication => auth}/confirm-mail.js | 0 .../forgot-password.js | 0 pages/auth/index.js | 5 ++ pages/{authentication => auth}/lock-screen.js | 0 pages/{authentication => auth}/logout.js | 0 pages/{authentication => auth}/sign-in.js | 0 pages/{authentication => auth}/sign-up.js | 0 12 files changed, 59 insertions(+), 43 deletions(-) rename pages/{authentication => auth}/confirm-mail.js (100%) rename pages/{authentication => auth}/forgot-password.js (100%) create mode 100644 pages/auth/index.js rename pages/{authentication => auth}/lock-screen.js (100%) rename pages/{authentication => auth}/logout.js (100%) rename pages/{authentication => auth}/sign-in.js (100%) rename pages/{authentication => auth}/sign-up.js (100%) diff --git a/components/_App/Layout.js b/components/_App/Layout.js index 848acdf..8f0ca2d 100644 --- a/components/_App/Layout.js +++ b/components/_App/Layout.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import Head from "next/head"; import { useRouter } from "next/router"; import LeftSidebar from "@/components/_App/LeftSidebar"; @@ -12,20 +12,30 @@ const Layout = ({ children }) => { const router = useRouter(); const [active, setActive] = useState(false); + const [isAuthenticationPage, setIsAuthenticationPage] = useState(false); + const toggleActive = () => { setActive(!active); }; - const isAuthenticationPage = [ - "/authentication/sign-in", - "/authentication/sign-up", - "/authentication/forgot-password", - "/authentication/lock-screen", - "/authentication/confirm-mail", - "/authentication/logout", - ].includes(router.pathname); + useEffect(() => { + const authenticationPages = [ + "/auth", + "/auth/sign-in", + "/auth/sign-up", + "/auth/forgot-password", + "/auth/lock-screen", + "/auth/confirm-mail", + "/auth/logout", + ]; - const title = isAuthenticationPage ? "CMC - Authentication" : "CMC - Client"; + setIsAuthenticationPage(authenticationPages.includes(router.pathname)); + }, [router.pathname]); + + // Debugging: Log the value of isAuthenticationPage + console.log("isAuthenticationPage:", isAuthenticationPage, router.pathname); + + const title = isAuthenticationPage ? "CMC - auth" : "CMC - dashboard"; return ( <> @@ -34,24 +44,22 @@ const Layout = ({ children }) => { - -
- {!isAuthenticationPage && ( - <> - - - - )} +
+ {!isAuthenticationPage && ( + <> + + + + )} -
{children}
+
{children}
- {!isAuthenticationPage &&
} -
+ {!isAuthenticationPage &&
} +
- + - {!isAuthenticationPage && } -
+ {!isAuthenticationPage && } ); }; diff --git a/components/_App/LeftSidebar/index.js b/components/_App/LeftSidebar/index.js index 1db8c0a..bbd1224 100644 --- a/components/_App/LeftSidebar/index.js +++ b/components/_App/LeftSidebar/index.js @@ -29,7 +29,7 @@ const SidebarWrap = styled("div")(({ theme }) => ({ width: '100%' })); -const Sidebar = ({ toogleActive }) => { +const Sidebar = ({ toggleActive }) => { return ( <>
@@ -58,11 +58,12 @@ const Sidebar = ({ toogleActive }) => { diff --git a/components/_App/TopNavbar/index.js b/components/_App/TopNavbar/index.js index 5b893ab..111190f 100644 --- a/components/_App/TopNavbar/index.js +++ b/components/_App/TopNavbar/index.js @@ -7,7 +7,7 @@ import Profile from "./Profile"; import Tooltip from "@mui/material/Tooltip"; import CurrentDate from "./CurrentDate"; -const TopNavbar = ({ toogleActive }) => { +const TopNavbar = ({ toggleActive }) => { return ( <>
@@ -28,7 +28,7 @@ const TopNavbar = ({ toogleActive }) => { size="sm" edge="start" color="inherit" - onClick={toogleActive} + onClick={toggleActive} > diff --git a/middlewares/AuthRoute.js b/middlewares/AuthRoute.js index ebccbf3..7d59713 100644 --- a/middlewares/AuthRoute.js +++ b/middlewares/AuthRoute.js @@ -14,7 +14,7 @@ const AuthRoute = ({ children }) => { const isAuthenticated = true; // In a real application, this would be determined based on the user's authentication status. if (!isAuthenticated) { - router.push("/authentication/sign-in/"); + router.push("/auth/"); } }, [router]); diff --git a/pages/_app.js b/pages/_app.js index 357fad2..feaebbe 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,34 +1,36 @@ -import React from 'react'; -import '../styles/remixicon.css' -import 'react-tabs/style/react-tabs.css'; +import React from "react"; +import "../styles/remixicon.css"; +import "react-tabs/style/react-tabs.css"; import "swiper/css"; import "swiper/css/bundle"; // Chat Styles -import '../styles/chat.css' +import "../styles/chat.css"; // Globals Styles -import '../styles/globals.css' +import "../styles/globals.css"; // Rtl Styles -import '../styles/rtl.css' +import "../styles/rtl.css"; // Dark Mode Styles -import '../styles/dark.css' +import "../styles/dark.css"; // Theme Styles -import theme from '../styles/theme' +import theme from "../styles/theme"; import { ThemeProvider, CssBaseline } from "@mui/material"; import Layout from "@/components/_App/Layout"; +import AuthRoute from "middlewares/AuthRoute"; function MyApp({ Component, pageProps }) { - return ( <> - - - + + + + + ); } -export default MyApp +export default MyApp; diff --git a/pages/authentication/confirm-mail.js b/pages/auth/confirm-mail.js similarity index 100% rename from pages/authentication/confirm-mail.js rename to pages/auth/confirm-mail.js diff --git a/pages/authentication/forgot-password.js b/pages/auth/forgot-password.js similarity index 100% rename from pages/authentication/forgot-password.js rename to pages/auth/forgot-password.js diff --git a/pages/auth/index.js b/pages/auth/index.js new file mode 100644 index 0000000..030724c --- /dev/null +++ b/pages/auth/index.js @@ -0,0 +1,5 @@ +import SignInForm from "@/components/Authentication/SignInForm"; + +export default function Index() { + return ; +} diff --git a/pages/authentication/lock-screen.js b/pages/auth/lock-screen.js similarity index 100% rename from pages/authentication/lock-screen.js rename to pages/auth/lock-screen.js diff --git a/pages/authentication/logout.js b/pages/auth/logout.js similarity index 100% rename from pages/authentication/logout.js rename to pages/auth/logout.js diff --git a/pages/authentication/sign-in.js b/pages/auth/sign-in.js similarity index 100% rename from pages/authentication/sign-in.js rename to pages/auth/sign-in.js diff --git a/pages/authentication/sign-up.js b/pages/auth/sign-up.js similarity index 100% rename from pages/authentication/sign-up.js rename to pages/auth/sign-up.js From c92644222e35202f7623c401c6016b03eaf195f0 Mon Sep 17 00:00:00 2001 From: Chief Bube Date: Wed, 18 Oct 2023 00:47:32 -0700 Subject: [PATCH 3/3] changed all paths with authentication to auth --- components/Authentication/ForgotPasswordForm.js | 2 +- components/Authentication/SignInForm.js | 2 +- components/Authentication/SignUpForm.js | 4 ++-- components/_App/LeftSidebar/SidebarData.js | 12 ++++++------ components/_App/TopNavbar/Profile.js | 2 +- pages/auth/logout.js | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/components/Authentication/ForgotPasswordForm.js b/components/Authentication/ForgotPasswordForm.js index 2cbcb86..96ea043 100644 --- a/components/Authentication/ForgotPasswordForm.js +++ b/components/Authentication/ForgotPasswordForm.js @@ -104,7 +104,7 @@ const ForgotPasswordForm = () => { Back to Sign in diff --git a/components/Authentication/SignInForm.js b/components/Authentication/SignInForm.js index 41a4864..2e2e2f1 100644 --- a/components/Authentication/SignInForm.js +++ b/components/Authentication/SignInForm.js @@ -128,7 +128,7 @@ const SignInForm = () => { Forgot your password? diff --git a/components/Authentication/SignUpForm.js b/components/Authentication/SignUpForm.js index b1f68a7..03dea95 100644 --- a/components/Authentication/SignUpForm.js +++ b/components/Authentication/SignUpForm.js @@ -45,7 +45,7 @@ const SignUpForm = () => { Already have an account?{" "} Sign in @@ -204,7 +204,7 @@ const SignUpForm = () => { Forgot your password? diff --git a/components/_App/LeftSidebar/SidebarData.js b/components/_App/LeftSidebar/SidebarData.js index 69434c0..d9f7457 100644 --- a/components/_App/LeftSidebar/SidebarData.js +++ b/components/_App/LeftSidebar/SidebarData.js @@ -450,7 +450,7 @@ export const SidebarData = [ }, { title: "Authentication", - path: "/authentication/sign-in/", + path: "/auth/sign-in/", icon: , iconClosed: , iconOpened: , @@ -458,23 +458,23 @@ export const SidebarData = [ subNav: [ { title: "Sign Up", - path: "/authentication/sign-up/", + path: "/auth/sign-up/", }, { title: "Forgot Password", - path: "/authentication/forgot-password/", + path: "/auth/forgot-password/", }, { title: "Lock Screen", - path: "/authentication/lock-screen/", + path: "/auth/lock-screen/", }, { title: "Confirm Mail", - path: "/authentication/confirm-mail/", + path: "/auth/confirm-mail/", }, { title: "Logout", - path: "/authentication/logout/", + path: "/auth/logout/", }, ], }, diff --git a/components/_App/TopNavbar/Profile.js b/components/_App/TopNavbar/Profile.js index e3a28fa..8c8c93a 100644 --- a/components/_App/TopNavbar/Profile.js +++ b/components/_App/TopNavbar/Profile.js @@ -183,7 +183,7 @@ const Profile = () => {