From 780acca33a1b887b10d9482834a54318f0756373 Mon Sep 17 00:00:00 2001 From: Shruti78 Date: Mon, 10 Feb 2025 20:09:15 +0530 Subject: [PATCH] fixed drawer shifting issue Signed-off-by: Shruti78 fixed logo fix issue Signed-off-by: Shruti78 Save changes to Queues.jsx --- frontend/src/components/Layout.jsx | 132 +++++++++++++++-------------- frontend/src/components/Queues.jsx | 4 +- 2 files changed, 70 insertions(+), 66 deletions(-) diff --git a/frontend/src/components/Layout.jsx b/frontend/src/components/Layout.jsx index 43d3770..4fba891 100644 --- a/frontend/src/components/Layout.jsx +++ b/frontend/src/components/Layout.jsx @@ -1,5 +1,5 @@ -import React, {useState} from "react"; -import {Link, Outlet, useLocation} from "react-router-dom"; +import React, { useState } from "react"; +import { Link, Outlet, useLocation } from "react-router-dom"; import { AppBar, Box, @@ -11,24 +11,23 @@ import { ListItemText, Toolbar, Typography, + Backdrop, } from "@mui/material"; import MenuIcon from "@mui/icons-material/Menu"; -import CloudIcon from '@mui/icons-material/Cloud'; -import HomeIcon from '@mui/icons-material/Home'; -import AssignmentIcon from '@mui/icons-material/Assignment'; -import WorkspacesIcon from '@mui/icons-material/Workspaces'; +import CloudIcon from "@mui/icons-material/Cloud"; +import HomeIcon from "@mui/icons-material/Home"; +import AssignmentIcon from "@mui/icons-material/Assignment"; +import WorkspacesIcon from "@mui/icons-material/Workspaces"; -// use relative path to load Logo -import volcanoLogo from '../assets/volcano-icon-color.svg'; +// Logo import +import volcanoLogo from "../assets/volcano-icon-color.svg"; const Layout = () => { - // Hooks must be used inside component functions const location = useLocation(); - const [open, setOpen] = useState(true); + const [open, setOpen] = useState(false); // Set default to false for overlay effect - // constants can be kept outside the component - const volcanoOrange = "#E34C26"; // orange red theme - const headerGrey = "#424242"; // dark gray top stripe + const volcanoOrange = "#E34C26"; + const headerGrey = "#424242"; const drawerWidth = 240; const handleDrawerToggle = () => { @@ -36,14 +35,15 @@ const Layout = () => { }; const menuItems = [ - {text: "Dashboard", icon: , path: "/dashboard"}, - {text: "Jobs", icon: , path: "/jobs"}, - {text: "Queues", icon: , path: "/queues"}, - {text: "Pods", icon: , path: "/pods"}, + { text: "Dashboard", icon: , path: "/dashboard" }, + { text: "Jobs", icon: , path: "/jobs" }, + { text: "Queues", icon: , path: "/queues" }, + { text: "Pods", icon: , path: "/pods" }, ]; return ( - + + {/* Top Navigation Bar */} { aria-label="toggle drawer" onClick={handleDrawerToggle} edge="start" - sx={{mr: 2, color: "white"}} + sx={{ mr: 2, color: "white" }} > - + Volcano Dashboard + {/* Drawer (Overlay Style) */} - - + + {menuItems.map((item) => ( { }} > {item.icon} - {open && } + ))} - {/* Logo and text part */} + + {/* Logo Section */} { alignItems: "center", mt: "auto", mb: 1, - // borderTop: "1px solid rgba(0, 0, 0, 0.12)", }} > - Volcano Logo - {/* {open && ( - - VOLCANO - - )} */} +Volcano Logo + + {/* Backdrop (Dim screen when drawer is open) */} + {open && ( + theme.zIndex.drawer - 1, backgroundColor: "rgba(0,0,0,0.4)" }} + /> + )} + + {/* Main Content */} - - + + ); diff --git a/frontend/src/components/Queues.jsx b/frontend/src/components/Queues.jsx index e38c4cc..9f4a547 100644 --- a/frontend/src/components/Queues.jsx +++ b/frontend/src/components/Queues.jsx @@ -371,7 +371,7 @@ const Queues = () => { - {sortedQueues + {sortedQueues .map((queue) => ( { ))} - < /TableBody> +