diff --git a/docs/job_page.png b/docs/job_page.png index 87faf88..5c6ee84 100644 Binary files a/docs/job_page.png and b/docs/job_page.png differ diff --git a/docs/login.png b/docs/login.png index b28c551..cc94522 100644 Binary files a/docs/login.png and b/docs/login.png differ diff --git a/docs/main_page.png b/docs/main_page.png index 811fbc5..a55bda3 100644 Binary files a/docs/main_page.png and b/docs/main_page.png differ diff --git a/src/components/NavDrawer.tsx b/src/components/NavDrawer.tsx index b251984..a67a21e 100644 --- a/src/components/NavDrawer.tsx +++ b/src/components/NavDrawer.tsx @@ -1,113 +1,138 @@ -import React, { useState } from "react"; +import React from "react"; import { useAuth } from "../contexts/AuthContext"; import { Box, - Drawer, List, ListItem, ListItemIcon, ListItemButton, ListItemText, - AppBar, - Toolbar, - IconButton, Typography, Button, Switch, Tooltip, + Drawer, + Divider, + Accordion, + AccordionSummary, + AccordionDetails, } from "@mui/material"; import HomeIcon from "@mui/icons-material/Home"; import HttpIcon from "@mui/icons-material/Http"; -import MenuIcon from "@mui/icons-material/Menu"; +import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import { useRouter } from "next/router"; +import { useTheme } from "@mui/material/styles"; interface NavDrawerProps { toggleTheme: () => void; isDarkMode: boolean; } +const drawerWidth = 240; + const NavDrawer: React.FC = ({ toggleTheme, isDarkMode }) => { const router = useRouter(); - const { login, logout, user, isAuthenticated } = useAuth(); - const [open, setOpen] = useState(false); - - const toggleDrawer = - (open: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => { - if ( - event.type === "keydown" && - ((event as React.KeyboardEvent).key === "Tab" || - (event as React.KeyboardEvent).key === "Shift") - ) { - return; - } - setOpen(open); - }; - - const DrawerList = ( - - - - router.push("/")}> - - - - Home - - - - router.push("/jobs")}> - - - - Previous Jobs - - - - - ); + const theme = useTheme(); + const { logout, user, isAuthenticated } = useAuth(); return ( - <> - - -
- - - - - - -
+ + +
+ + + router.push("/")}> + + + + + + + + + router.push("/jobs")}> + + + + + + + + +
+ {isAuthenticated ? ( -
- + <> + Welcome, {user?.full_name} - -
+ ) : ( - )} -
-
- - {DrawerList} - - + + + } + aria-controls="panel1a-content" + id="panel1a-header" + > + Settings + + + + + + + + + + ); }; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index f586dc0..43defe3 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -4,11 +4,13 @@ import "../styles/globals.css"; import React, { useState, useEffect } from "react"; import type { AppProps } from "next/app"; import Head from "next/head"; -import { ThemeProvider, CssBaseline } from "@mui/material"; +import { ThemeProvider, CssBaseline, Box } from "@mui/material"; import NavDrawer from "../components/NavDrawer"; import { darkTheme, lightTheme } from "../styles/themes"; import { AuthProvider } from "../contexts/AuthContext"; +const drawerWidth = 240; + const App: React.FC = ({ Component, pageProps }) => { const [isDarkMode, setIsDarkMode] = useState(false); @@ -38,8 +40,19 @@ const App: React.FC = ({ Component, pageProps }) => { - - + + + + + +