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