added wrenchboard icons #2
@@ -1,10 +1,11 @@
|
||||
"use client"
|
||||
"use client";
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
/**
|
||||
* This is used to protect routes in a web application.
|
||||
* This function is used to protect routes in a web application.
|
||||
* It checks if the user is authenticated and redirects them to the sign-in page if they are not.
|
||||
|
||||
*/
|
||||
const AuthRoute = ({ children }) => {
|
||||
const router = useRouter();
|
||||
@@ -14,7 +15,7 @@ const AuthRoute = ({ children }) => {
|
||||
|
||||
if (!isAuthenticated) {
|
||||
router.push("/authentication/sign-in/");
|
||||
}
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return <>{children}</>;
|
||||
|
||||
+1
-1
@@ -3,7 +3,6 @@ import '../styles/remixicon.css'
|
||||
import 'react-tabs/style/react-tabs.css';
|
||||
import "swiper/css";
|
||||
import "swiper/css/bundle";
|
||||
|
||||
// Chat Styles
|
||||
import '../styles/chat.css'
|
||||
// Globals Styles
|
||||
@@ -19,6 +18,7 @@ import { ThemeProvider, CssBaseline } from "@mui/material";
|
||||
import Layout from "@/components/_App/Layout";
|
||||
|
||||
function MyApp({ Component, pageProps }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ThemeProvider theme={theme}>
|
||||
|
||||
@@ -15,7 +15,6 @@ import RecentOrders from "@/components/Dashboard/eCommerce/RecentOrders";
|
||||
import TeamMembersList from "@/components/Dashboard/eCommerce/TeamMembersList";
|
||||
import BestSellingProducts from "@/components/Dashboard/eCommerce/BestSellingProducts";
|
||||
import LiveVisitsOnOurSite from "@/components/Dashboard/eCommerce/LiveVisitsOnOurSite";
|
||||
import AuthRoute from "middlewares/AuthRoute";
|
||||
|
||||
function MainPage() {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user