diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index cbd3257..d2bcd8d 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,10 +1,10 @@ import "./App.css"; -import { BrowserRouter, Route, Routes } from "react-router-dom"; +import { Route, Routes, useLocation } from "react-router-dom"; import TestAuth from "./components/testAuth"; import LoginPage from "./components/authentication/LoginPage"; import SignUpPage from "./components/authentication/SignUpPage"; -import NavBar from "./components/nav/Navbar"; +import NavBar from "./components/Nav/Navbar"; import Home from "./components/Home"; import ProfileUpdate from "./components/ProfileUpdatePage"; import Calendar from "./components/calendar/calendar"; @@ -13,16 +13,16 @@ import IconSideNav from "./components/IconSideNav"; import Eisenhower from "./components/eisenhowerMatrix/Eisenhower"; const App = () => { - const currentPath = window.location.pathname; + const location = useLocation(); const prevention = ["/login", "/signup"]; + const isLoginPageOrSignUpPage = prevention.some(_ => location.pathname.includes(_)); return ( - -
- {!prevention.some(_ => currentPath.includes(_)) && } -
+
+ {!isLoginPageOrSignUpPage && } +
-
+
} /> } /> @@ -30,15 +30,12 @@ const App = () => { } /> } /> } /> + } /> + } />
- - } /> - } /> - - ); }; diff --git a/frontend/src/components/IconSideNav.jsx b/frontend/src/components/IconSideNav.jsx index 0620f28..982bc01 100644 --- a/frontend/src/components/IconSideNav.jsx +++ b/frontend/src/components/IconSideNav.jsx @@ -1,18 +1,20 @@ import { useState } from "react"; +import { + AiOutlineHome, + AiOutlineSchedule, + AiOutlineUnorderedList, + AiOutlinePieChart, + AiOutlinePlus, +} from "react-icons/ai"; import { AnimatePresence, motion } from "framer-motion"; import { Link, useNavigate } from "react-router-dom"; -import homeLogo from "../assets/home.png"; -import calendarLogo from "../assets/calendar.png"; -import planLogo from "../assets/planning.png"; -import pieLogo from "../assets/pie-chart.png"; -import plusLogo from "../assets/plus.png"; const menuItems = [ - { id: 0, path: "/", icon: , logo: homeLogo }, - { id: 1, path: "/tasks", icon: , logo: planLogo }, - { id: 2, path: "/calendar", icon: , logo: calendarLogo }, - { id: 3, path: "/analytic", icon: , logo: pieLogo }, - { id: 4, path: "/priority", icon: , logo: plusLogo }, + { id: 0, path: "/", icon: }, + { id: 1, path: "/tasks", icon: }, + { id: 2, path: "/calendar", icon: }, + { id: 3, path: "/analytic", icon: }, + { id: 4, path: "/priority", icon: }, ]; const IconSideNav = () => { @@ -28,14 +30,13 @@ const SideNav = () => { return (