From 9b75ecf86802011f92f25d92ce11b6702acb49c5 Mon Sep 17 00:00:00 2001 From: Malopieds Date: Thu, 17 Oct 2024 22:18:34 +0200 Subject: [PATCH] feat: dashboard --- src/App.tsx | 14 +-- src/component/Navigation/Navigation.tsx | 8 +- src/pages/Dashboard.tsx | 127 +++++++++++++++------- src/pages/PageTest.tsx | 136 ++++++++++-------------- src/pages/Practical.tsx | 8 +- src/pages/Practicals.tsx | 1 - 6 files changed, 156 insertions(+), 138 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index e3b200f..b2c141c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,11 +12,12 @@ import CreateTp from "./pages/admin/CreateTp"; import BulkUsers from "./pages/admin/BulkCreateUser"; import Users from "./pages/admin/Users"; import { ToastContainer } from "react-toastify"; +import "react-toastify/dist/ReactToastify.css"; function App() { - const [showNotif, setShowNotif] = useState(false); return ( + } /> @@ -31,18 +32,7 @@ function App() { } /> - - {showNotif && ( -
-
- Message sent successfully. - -
-
- )}
); } diff --git a/src/component/Navigation/Navigation.tsx b/src/component/Navigation/Navigation.tsx index 2bc2c38..e6a2b4a 100644 --- a/src/component/Navigation/Navigation.tsx +++ b/src/component/Navigation/Navigation.tsx @@ -10,6 +10,7 @@ import { } from "@heroicons/react/24/outline"; import { Link, useNavigate } from "react-router-dom"; import axios from "axios"; +import { ToastContainer } from "react-toastify"; interface NavigationProps { children: React.ReactElement; @@ -20,9 +21,7 @@ const Navigation: React.FC = ({ }: NavigationProps) => { const [isDrawerOpen, setIsDrawerOpen] = useState(false); const toggleDrawer = () => setIsDrawerOpen(!isDrawerOpen); - const [user, setUser] = useState(null); const navigate = useNavigate(); - const [theme, setTheme] = useState( localStorage.getItem("theme") ? localStorage.getItem("theme") : "dark", ); @@ -47,7 +46,6 @@ const Navigation: React.FC = ({ if (res.data.username.trim() === "") { navigate("/login"); } - setUser(res.data); }); localStorage.setItem("theme", theme); const localTheme = localStorage.getItem("theme"); @@ -63,6 +61,7 @@ const Navigation: React.FC = ({ type="checkbox" className="drawer-toggle" checked={isDrawerOpen} + onChange={() => {}} />
{location.pathname !== "/login" && ( @@ -70,9 +69,8 @@ const Navigation: React.FC = ({
-