Merge branch 'Logo-addition' of Controls/CMS-Client into master
This commit is contained in:
@@ -104,7 +104,7 @@ const ForgotPasswordForm = () => {
|
|||||||
|
|
||||||
<Box as="div" textAlign="center" mt="20px">
|
<Box as="div" textAlign="center" mt="20px">
|
||||||
<Link
|
<Link
|
||||||
href="/authentication/sign-in/"
|
href="/auth/sign-in/"
|
||||||
className="primaryColor text-decoration-none"
|
className="primaryColor text-decoration-none"
|
||||||
>
|
>
|
||||||
<i className="ri-arrow-left-s-line"></i> Back to Sign in
|
<i className="ri-arrow-left-s-line"></i> Back to Sign in
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ const SignInForm = () => {
|
|||||||
|
|
||||||
<Grid item xs={6} sm={6} textAlign="end">
|
<Grid item xs={6} sm={6} textAlign="end">
|
||||||
<Link
|
<Link
|
||||||
href="/authentication/forgot-password"
|
href="/auth/forgot-password"
|
||||||
className="primaryColor text-decoration-none"
|
className="primaryColor text-decoration-none"
|
||||||
>
|
>
|
||||||
Forgot your password?
|
Forgot your password?
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const SignUpForm = () => {
|
|||||||
<Typography fontSize="15px" mb="30px">
|
<Typography fontSize="15px" mb="30px">
|
||||||
Already have an account?{" "}
|
Already have an account?{" "}
|
||||||
<Link
|
<Link
|
||||||
href="/authentication/sign-in/"
|
href="/auth/sign-in/"
|
||||||
className="primaryColor text-decoration-none"
|
className="primaryColor text-decoration-none"
|
||||||
>
|
>
|
||||||
Sign in
|
Sign in
|
||||||
@@ -204,7 +204,7 @@ const SignUpForm = () => {
|
|||||||
|
|
||||||
<Grid item xs={6} sm={6} textAlign="end">
|
<Grid item xs={6} sm={6} textAlign="end">
|
||||||
<Link
|
<Link
|
||||||
href="/authentication/forgot-password"
|
href="/auth/forgot-password"
|
||||||
className="primaryColor text-decoration-none"
|
className="primaryColor text-decoration-none"
|
||||||
>
|
>
|
||||||
Forgot your password?
|
Forgot your password?
|
||||||
|
|||||||
+32
-24
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import LeftSidebar from "@/components/_App/LeftSidebar";
|
import LeftSidebar from "@/components/_App/LeftSidebar";
|
||||||
@@ -12,20 +12,30 @@ const Layout = ({ children }) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [active, setActive] = useState(false);
|
const [active, setActive] = useState(false);
|
||||||
|
|
||||||
|
const [isAuthenticationPage, setIsAuthenticationPage] = useState(false);
|
||||||
|
|
||||||
const toggleActive = () => {
|
const toggleActive = () => {
|
||||||
setActive(!active);
|
setActive(!active);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isAuthenticationPage = [
|
useEffect(() => {
|
||||||
"/authentication/sign-in",
|
const authenticationPages = [
|
||||||
"/authentication/sign-up",
|
"/auth",
|
||||||
"/authentication/forgot-password",
|
"/auth/sign-in",
|
||||||
"/authentication/lock-screen",
|
"/auth/sign-up",
|
||||||
"/authentication/confirm-mail",
|
"/auth/forgot-password",
|
||||||
"/authentication/logout",
|
"/auth/lock-screen",
|
||||||
].includes(router.pathname);
|
"/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 (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -34,24 +44,22 @@ const Layout = ({ children }) => {
|
|||||||
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<AuthRoute>
|
<div className={`main-wrapper-content ${active ? "active" : ""}`}>
|
||||||
<div className={`main-wrapper-content ${active ? "active" : ""}`}>
|
{!isAuthenticationPage && (
|
||||||
{!isAuthenticationPage && (
|
<>
|
||||||
<>
|
<TopNavbar toggleActive={toggleActive} />
|
||||||
<TopNavbar toggleActive={toggleActive} />
|
<LeftSidebar toggleActive={toggleActive} />
|
||||||
<LeftSidebar toggleActive={toggleActive} />
|
</>
|
||||||
</>
|
)}
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="main-content">{children}</div>
|
<div className="main-content">{children}</div>
|
||||||
|
|
||||||
{!isAuthenticationPage && <Footer />}
|
{!isAuthenticationPage && <Footer />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ScrollToTop />
|
<ScrollToTop />
|
||||||
|
|
||||||
{!isAuthenticationPage && <ControlPanelModal />}
|
{!isAuthenticationPage && <ControlPanelModal />}
|
||||||
</AuthRoute>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ export const SidebarData = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Authentication",
|
title: "Authentication",
|
||||||
path: "/authentication/sign-in/",
|
path: "/auth/sign-in/",
|
||||||
icon: <LockIcon />,
|
icon: <LockIcon />,
|
||||||
iconClosed: <KeyboardArrowRightIcon />,
|
iconClosed: <KeyboardArrowRightIcon />,
|
||||||
iconOpened: <KeyboardArrowDownIcon />,
|
iconOpened: <KeyboardArrowDownIcon />,
|
||||||
@@ -458,23 +458,23 @@ export const SidebarData = [
|
|||||||
subNav: [
|
subNav: [
|
||||||
{
|
{
|
||||||
title: "Sign Up",
|
title: "Sign Up",
|
||||||
path: "/authentication/sign-up/",
|
path: "/auth/sign-up/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Forgot Password",
|
title: "Forgot Password",
|
||||||
path: "/authentication/forgot-password/",
|
path: "/auth/forgot-password/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Lock Screen",
|
title: "Lock Screen",
|
||||||
path: "/authentication/lock-screen/",
|
path: "/auth/lock-screen/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Confirm Mail",
|
title: "Confirm Mail",
|
||||||
path: "/authentication/confirm-mail/",
|
path: "/auth/confirm-mail/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Logout",
|
title: "Logout",
|
||||||
path: "/authentication/logout/",
|
path: "/auth/logout/",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const SidebarWrap = styled("div")(({ theme }) => ({
|
|||||||
width: '100%'
|
width: '100%'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const Sidebar = ({ toogleActive }) => {
|
const Sidebar = ({ toggleActive }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='leftSidebarDark'>
|
<div className='leftSidebarDark'>
|
||||||
@@ -58,11 +58,12 @@ const Sidebar = ({ toogleActive }) => {
|
|||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={toogleActive}
|
onClick={toggleActive}
|
||||||
size="small"
|
size="small"
|
||||||
sx={{
|
sx={{
|
||||||
background: 'rgb(253, 237, 237)',
|
background: 'rgb(253, 237, 237)',
|
||||||
display: { lg: 'none' }
|
display: { lg: 'none' },
|
||||||
|
marginLeft: "1rem"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ClearIcon />
|
<ClearIcon />
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ const Profile = () => {
|
|||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
href="/authentication/logout/"
|
href="/auth/logout/"
|
||||||
fontSize="13px"
|
fontSize="13px"
|
||||||
color="inherit"
|
color="inherit"
|
||||||
underline="none"
|
underline="none"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Profile from "./Profile";
|
|||||||
import Tooltip from "@mui/material/Tooltip";
|
import Tooltip from "@mui/material/Tooltip";
|
||||||
import CurrentDate from "./CurrentDate";
|
import CurrentDate from "./CurrentDate";
|
||||||
|
|
||||||
const TopNavbar = ({ toogleActive }) => {
|
const TopNavbar = ({ toggleActive }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="topNavbarDark">
|
<div className="topNavbarDark">
|
||||||
@@ -28,7 +28,7 @@ const TopNavbar = ({ toogleActive }) => {
|
|||||||
size="sm"
|
size="sm"
|
||||||
edge="start"
|
edge="start"
|
||||||
color="inherit"
|
color="inherit"
|
||||||
onClick={toogleActive}
|
onClick={toggleActive}
|
||||||
>
|
>
|
||||||
<i className="ri-align-left"></i>
|
<i className="ri-align-left"></i>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|||||||
+1
-1
@@ -96,7 +96,7 @@ RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
|
|||||||
&& yarn --version
|
&& yarn --version
|
||||||
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
# ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
# COPY docker-entrypoint.sh /usr/local/bin/
|
# COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
# ENTRYPOINT ["docker-entrypoint.sh"]
|
# ENTRYPOINT ["docker-entrypoint.sh"]
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
const isAuthenticated = true; // In a real application, this would be determined based on the user's authentication status.
|
||||||
|
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated) {
|
||||||
router.push("/authentication/sign-in/");
|
router.push("/auth/");
|
||||||
}
|
}
|
||||||
}, [router]);
|
}, [router]);
|
||||||
|
|
||||||
|
|||||||
+15
-13
@@ -1,34 +1,36 @@
|
|||||||
import React from 'react';
|
import React from "react";
|
||||||
import '../styles/remixicon.css'
|
import "../styles/remixicon.css";
|
||||||
import 'react-tabs/style/react-tabs.css';
|
import "react-tabs/style/react-tabs.css";
|
||||||
import "swiper/css";
|
import "swiper/css";
|
||||||
import "swiper/css/bundle";
|
import "swiper/css/bundle";
|
||||||
// Chat Styles
|
// Chat Styles
|
||||||
import '../styles/chat.css'
|
import "../styles/chat.css";
|
||||||
// Globals Styles
|
// Globals Styles
|
||||||
import '../styles/globals.css'
|
import "../styles/globals.css";
|
||||||
// Rtl Styles
|
// Rtl Styles
|
||||||
import '../styles/rtl.css'
|
import "../styles/rtl.css";
|
||||||
// Dark Mode Styles
|
// Dark Mode Styles
|
||||||
import '../styles/dark.css'
|
import "../styles/dark.css";
|
||||||
// Theme Styles
|
// Theme Styles
|
||||||
import theme from '../styles/theme'
|
import theme from "../styles/theme";
|
||||||
|
|
||||||
import { ThemeProvider, CssBaseline } from "@mui/material";
|
import { ThemeProvider, CssBaseline } from "@mui/material";
|
||||||
import Layout from "@/components/_App/Layout";
|
import Layout from "@/components/_App/Layout";
|
||||||
|
import AuthRoute from "middlewares/AuthRoute";
|
||||||
|
|
||||||
function MyApp({ Component, pageProps }) {
|
function MyApp({ Component, pageProps }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
<Layout>
|
<AuthRoute>
|
||||||
<Component {...pageProps} />
|
<Layout>
|
||||||
</Layout>
|
<Component {...pageProps} />
|
||||||
|
</Layout>
|
||||||
|
</AuthRoute>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MyApp
|
export default MyApp;
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import SignInForm from "@/components/Authentication/SignInForm";
|
||||||
|
|
||||||
|
export default function Index() {
|
||||||
|
return <SignInForm />;
|
||||||
|
}
|
||||||
@@ -51,7 +51,7 @@ export default function Logout() {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
href="/authentication/sign-in/"
|
href="/auth/sign-in/"
|
||||||
fullWidth
|
fullWidth
|
||||||
variant="contained"
|
variant="contained"
|
||||||
sx={{
|
sx={{
|
||||||
Reference in New Issue
Block a user