Updated layout (#450)
* Updated layout * Fixed error * Changed integration background to white
This commit is contained in:
1 parent
0339922db8
commit
40a268ab18
54 files changed
+441
-773
No files matched your search
@@ -35,7 +35,7 @@ const Avatar = ({ src, small, sx }) => {
|
||||
src ? src : user?.avatarImage ? image : "/static/images/avatar/2.jpg"
|
||||
}
|
||||
sx={{
|
||||
fontSize: small ? "12px" : "20px",
|
||||
fontSize: small ? "13px" : "20px",
|
||||
display: "inline-flex",
|
||||
"&::before": {
|
||||
content: `""`,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
:root {
|
||||
--spacing-general-0: 10px 25px;
|
||||
--spacing-general-0: 12px 18px;
|
||||
--spacing-general-1: 20px;
|
||||
--color-border-0: #eaecf0;
|
||||
--border-radius-0: 4px;
|
||||
@@ -12,17 +12,19 @@
|
||||
}
|
||||
|
||||
.server-status-tile {
|
||||
min-width: 250px;
|
||||
min-width: 100px;
|
||||
width: calc(100% - 310px);
|
||||
padding: var(--spacing-general-0);
|
||||
border: 1px solid var(--color-border-0);
|
||||
border-radius: var(--border-radius-0);
|
||||
background-color: var(--env-var-color-8);
|
||||
}
|
||||
|
||||
.server-status-tile-title {
|
||||
font-size: var(--font-size-0);
|
||||
font-weight: bold;
|
||||
margin-bottom: calc(var(--spacing-general-1) / 2);
|
||||
color: var(--env-var-color-1);
|
||||
}
|
||||
|
||||
.server-status-tile-value {
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
.dashboard-menu-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.text-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dashboard-menu-text {
|
||||
margin-left: 8px;
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
import "./index.css";
|
||||
import DashboardMenuButton from "../DashboardMenuButton";
|
||||
|
||||
import Monitors from "../../../assets/Images/Icon-monitor-gray.png";
|
||||
import Incidents from "../../../assets/Images/Icon-warning-gray.png";
|
||||
import SensorsIcon from "../../../assets/Images/Icon-signal-gray.png";
|
||||
import AllInclusiveIcon from "../../../assets/Images/Icon-link-gray.png";
|
||||
import MaintenanceIcon from "../../../assets/Images/Icon-maintenance-gray.png";
|
||||
import SettingsIcon from "../../../assets/Images/Icon-setting-gray.png";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import pathMap from "../../../Utils/PathMap";
|
||||
|
||||
/**
|
||||
* @component
|
||||
* DashboardMenu component displays a menu with icons and corresponding text.
|
||||
* Each menu item consists of an icon and a text label.
|
||||
*
|
||||
* @returns {JSX.Element} The JSX element representing the DashboardMenu component.
|
||||
*/
|
||||
|
||||
function DashboardMenu() {
|
||||
const [activeButton, setActiveButton] = useState(null);
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
setActiveButton(location.pathname);
|
||||
}, [location]);
|
||||
|
||||
const handleClick = (title, path) => {
|
||||
setActiveButton(title);
|
||||
navigate(path);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="dashboard-menu-container">
|
||||
{DashboardMenuButton(
|
||||
Monitors,
|
||||
"Monitors",
|
||||
"/monitors",
|
||||
activeButton === "/monitors",
|
||||
() => handleClick(pathMap["/monitors"], "/monitors")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
Incidents,
|
||||
"Incidents",
|
||||
"/incidents",
|
||||
activeButton === "/incidents",
|
||||
() => handleClick(pathMap["/incidents"], "/incidents")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
SensorsIcon,
|
||||
"Status Pages",
|
||||
"/status",
|
||||
activeButton === "/status",
|
||||
() => handleClick(pathMap["/status"], "/status")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
AllInclusiveIcon,
|
||||
"Integrations",
|
||||
"/integrations",
|
||||
activeButton === "/integrations",
|
||||
() => handleClick(pathMap["/integrations"], "/integrations")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
MaintenanceIcon,
|
||||
"Maintenance",
|
||||
"/maintenance",
|
||||
activeButton === "/maintenance",
|
||||
() => handleClick(pathMap["/maintenance"], "/maintenance")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
SettingsIcon,
|
||||
"Settings",
|
||||
"/settings",
|
||||
activeButton === "/settings",
|
||||
() => handleClick(pathMap["/settings"], "/settings")
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardMenu;
|
||||
@@ -1,23 +0,0 @@
|
||||
.icon-container {
|
||||
padding: 8px 15px;
|
||||
}
|
||||
|
||||
.icon-container:hover {
|
||||
background-color: var(--env-var-color-13);
|
||||
border-radius: var(--env-var-radius-1);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.icon-container.active {
|
||||
background-color: var(--env-var-color-13);
|
||||
border-radius: var(--env-var-radius-1);
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: var(--env-var-img-width-1);
|
||||
}
|
||||
|
||||
.dashboard-menu-text {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
color: var(--env-var-color-12);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import "./index.css";
|
||||
import React, { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
/**
|
||||
* Renders a menu button with an icon and title.
|
||||
*
|
||||
* @component
|
||||
* @param {React.ElementType} icon - The icon component to be rendered.
|
||||
* @param {string} title - The title of the menu button.
|
||||
* @returns {React.ReactElement} The rendered menu button component.
|
||||
*/
|
||||
|
||||
const DashboardMenuButton = (icon, title, to, isActive, onClick) => {
|
||||
const handleClick = () => {
|
||||
onClick();
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`icon-container ${isActive ? "active" : ""}`}
|
||||
onClick={handleClick}
|
||||
>
|
||||
<img className="icon" src={icon} alt="Monitors" />
|
||||
<div className="text-container">
|
||||
<span className="dashboard-menu-text">{title}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DashboardMenuButton;
|
||||
@@ -1,30 +0,0 @@
|
||||
.dashboard-sidebar {
|
||||
height: calc(100vh - var(--env-var-nav-bar-height));
|
||||
width: 250px;
|
||||
border: 1px solid var(--color-border-0);
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
top: 64px;
|
||||
position: sticky;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.support-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 28px 35px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.support-text {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
color: var(--env-var-color-12);
|
||||
}
|
||||
|
||||
.support-icon {
|
||||
width: var(--env-var-img-width-1);
|
||||
margin-right: 8px;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
import DashboardMenu from "../DashboardMenu";
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import "./index.css";
|
||||
import SupportIcon from "../../../assets/Images/Icon-support-gray.png";
|
||||
|
||||
/**
|
||||
* @component
|
||||
* DashboardSidebar component serves as a sidebar containing the DashboardMenu and a Support icon at the bottom.
|
||||
*
|
||||
* @returns {JSX.Element} The JSX element representing the DashboardSidebar component.
|
||||
*/
|
||||
|
||||
function DashboardSidebar() {
|
||||
return (
|
||||
<div className="dashboard-sidebar">
|
||||
<div className="menu-container">
|
||||
<DashboardMenu />
|
||||
</div>
|
||||
<div className="support-container">
|
||||
<img className="support-icon" src={SupportIcon} alt="SupportIcon" />
|
||||
<span className="support-text">Support</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardSidebar;
|
||||
Whitespace-only changes.
@@ -1,71 +0,0 @@
|
||||
import { Box, Typography, useTheme } from '@mui/material';
|
||||
import Button from '../Button';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* Integrations component
|
||||
* @param {Object} props - Props for the IntegrationsComponent.
|
||||
* @param {string} props.url - The URL for the integration image.
|
||||
* @param {string} props.header - The header for the integration.
|
||||
* @param {string} props.info - Information about the integration.
|
||||
* @param {Function} props.onClick - The onClick handler for the integration button.
|
||||
* @returns {JSX.Element} The JSX representation of the IntegrationsComponent.
|
||||
*/
|
||||
const IntegrationsComponent = ({ url, header, info, onClick }) => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<Box
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
p={theme.spacing(2)}
|
||||
border={1}
|
||||
borderColor={theme.palette.divider}
|
||||
borderRadius={theme.shape.borderRadius}
|
||||
>
|
||||
<Box
|
||||
component="img"
|
||||
src={url}
|
||||
alt="Integration"
|
||||
width={100}
|
||||
height={100}
|
||||
/>
|
||||
|
||||
<Box
|
||||
flex={1}
|
||||
mx={theme.spacing(2)}
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
alignItems="flex-start"
|
||||
>
|
||||
<Typography variant="h6" component="div" style={{ fontSize: '16px' }}>
|
||||
{header}
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body1"
|
||||
component="div"
|
||||
sx={{
|
||||
maxWidth: '300px',
|
||||
wordWrap: 'break-word',
|
||||
textAlign: 'left'
|
||||
}}
|
||||
style={{ fontSize: '13px' }}
|
||||
>
|
||||
{info}
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
<Button label="Click Me" level="primary" onClick={onClick} />
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
// PropTypes for IntegrationsComponent
|
||||
IntegrationsComponent.propTypes = {
|
||||
url: PropTypes.string.isRequired,
|
||||
header: PropTypes.string.isRequired,
|
||||
info: PropTypes.string.isRequired,
|
||||
onClick: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default IntegrationsComponent;
|
||||
@@ -1,18 +1,11 @@
|
||||
/* NavBar Component Styles*/
|
||||
.css-14ds6td-MuiPaper-root-MuiAppBar-root {
|
||||
height: var(--env-var-nav-bar-height);
|
||||
}
|
||||
|
||||
.icon-button-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.MuiToolbar-root {
|
||||
min-height: var(--env-var-nav-bar-height) !important;
|
||||
}
|
||||
|
||||
.icon-button-toggle-title {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
color: var(--env-var-color-5);
|
||||
margin-right: var(--env-var-spacing-2);
|
||||
}
|
||||
|
||||
.icon-button-toggle-pic {
|
||||
@@ -21,7 +14,6 @@
|
||||
}
|
||||
|
||||
#icon-button {
|
||||
color: transparent;
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
outline: none;
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import "./index.css";
|
||||
import { useState } from "react";
|
||||
import { cloneElement, useState } from "react";
|
||||
import AppBar from "@mui/material/AppBar";
|
||||
import Box from "@mui/material/Box";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import MenuIcon from "@mui/icons-material/Menu";
|
||||
import Container from "@mui/material/Container";
|
||||
import Avatar from "../Avatar";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import ChevronDown from "../../assets/Images/Icon-chevron-down.png";
|
||||
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
||||
import { clearAuthState } from "../../Features/Auth/authSlice";
|
||||
import { clearMonitorState } from "../../Features/Monitors/monitorsSlice";
|
||||
|
||||
@@ -21,9 +20,7 @@ import LockSvg from "../../assets/icons/lock.svg?react";
|
||||
import UserSvg from "../../assets/icons/user.svg?react";
|
||||
import TeamSvg from "../../assets/icons/user-two.svg?react";
|
||||
import LogoutSvg from "../../assets/icons/logout.svg?react";
|
||||
|
||||
import BWULogo from "../../assets/Images/bwl-logo.svg?react";
|
||||
import Avatar from "../Avatar";
|
||||
import { Stack, useScrollTrigger } from "@mui/material";
|
||||
|
||||
const icons = {
|
||||
Profile: <UserSvg />,
|
||||
@@ -32,6 +29,33 @@ const icons = {
|
||||
Logout: <LogoutSvg />,
|
||||
};
|
||||
|
||||
function AddBorderOnScroll(props) {
|
||||
const { children, window } = props;
|
||||
const trigger = useScrollTrigger({
|
||||
target: window ? window() : undefined,
|
||||
disableHysteresis: true,
|
||||
threshold: 0,
|
||||
});
|
||||
|
||||
return (
|
||||
<AppBar
|
||||
className={trigger ? "scrolled" : ""}
|
||||
position="sticky"
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
transition: "all 0.3s ease",
|
||||
borderBottom: "1px solid transparent",
|
||||
"&.scrolled": {
|
||||
borderBottom: "1px solid #eaecf0",
|
||||
backgroundColor: "white"
|
||||
},
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</AppBar>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* NavBar component
|
||||
*
|
||||
@@ -100,110 +124,62 @@ function NavBar() {
|
||||
};
|
||||
|
||||
return (
|
||||
<AppBar
|
||||
position="sticky"
|
||||
sx={{
|
||||
width: "100%",
|
||||
backgroundColor: "transparent",
|
||||
boxShadow: "none",
|
||||
borderBottom: "1px solid var(--color-border-0)",
|
||||
}}
|
||||
>
|
||||
<Container maxWidth="xxl" sx={{ width: "100%" }}>
|
||||
<Toolbar disableGutters>
|
||||
<BWULogo id="bw-uptime-logo-dashboard" alt="BlueWave Uptime Logo" />
|
||||
|
||||
<Box sx={{ flexGrow: 1, display: { xs: "flex", md: "none" } }}>
|
||||
<IconButton
|
||||
size="large"
|
||||
aria-label="account of current user"
|
||||
aria-controls="menu-appbar"
|
||||
aria-haspopup="true"
|
||||
color="inherit"
|
||||
>
|
||||
<MenuIcon />
|
||||
</IconButton>
|
||||
</Box>
|
||||
|
||||
<Typography
|
||||
variant="h5"
|
||||
noWrap
|
||||
component="a"
|
||||
href="#"
|
||||
sx={{
|
||||
mr: 2,
|
||||
display: { xs: "flex", md: "none" },
|
||||
flexGrow: 1,
|
||||
fontFamily: "monospace",
|
||||
fontWeight: theme.typography.fontWeightBold,
|
||||
letterSpacing: theme.spacing(0.3),
|
||||
color: "inherit",
|
||||
textDecoration: "none",
|
||||
}}
|
||||
<AddBorderOnScroll>
|
||||
<Toolbar disableGutters sx={{ alignSelf: "flex-end", paddingX: "25px" }}>
|
||||
<Tooltip title="Open settings">
|
||||
<IconButton
|
||||
id="icon-button"
|
||||
onClick={handleOpenUserMenu}
|
||||
sx={{ p: 0 }}
|
||||
>
|
||||
UPTIME GENIE
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ flexGrow: 1 }} />
|
||||
|
||||
<Box sx={{ flexGrow: 0 }}>
|
||||
<Tooltip title="Open settings">
|
||||
<IconButton
|
||||
id="icon-button"
|
||||
onClick={handleOpenUserMenu}
|
||||
sx={{ p: 0 }}
|
||||
<Stack direction="row" alignItems="center" gap="8px">
|
||||
<Avatar small={true} />
|
||||
<Box
|
||||
className="icon-button-toggle-title"
|
||||
sx={{ mr: "3px", lineHeight: 2 }}
|
||||
>
|
||||
<div className="icon-button-toggle">
|
||||
<Avatar small={true} sx={{ mr: "8px" }} />
|
||||
<div className="icon-button-toggle-title">
|
||||
{authState.user?.firstName} {authState.user?.lastName}
|
||||
</div>
|
||||
<img
|
||||
className="icon-button-toggle-pic"
|
||||
src={ChevronDown}
|
||||
alt="ChevronDown"
|
||||
/>
|
||||
</div>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Menu
|
||||
sx={{ mt: theme.spacing(5.5) }}
|
||||
id="menu-appbar"
|
||||
anchorEl={anchorElUser}
|
||||
anchorOrigin={{
|
||||
vertical: "top",
|
||||
horizontal: "right",
|
||||
}}
|
||||
keepMounted
|
||||
transformOrigin={{
|
||||
vertical: "top",
|
||||
horizontal: "right",
|
||||
}}
|
||||
open={Boolean(anchorElUser)}
|
||||
onClose={handleCloseUserMenu}
|
||||
{authState.user?.firstName} {authState.user?.lastName}
|
||||
</Box>
|
||||
<KeyboardArrowDownIcon sx={{ mt: "2px" }} />
|
||||
</Stack>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Menu
|
||||
sx={{ mt: theme.spacing(5.5) }}
|
||||
id="menu-appbar"
|
||||
anchorEl={anchorElUser}
|
||||
anchorOrigin={{
|
||||
vertical: "top",
|
||||
horizontal: "right",
|
||||
}}
|
||||
keepMounted
|
||||
transformOrigin={{
|
||||
vertical: "top",
|
||||
horizontal: "right",
|
||||
}}
|
||||
open={Boolean(anchorElUser)}
|
||||
onClose={handleCloseUserMenu}
|
||||
>
|
||||
{settings.map((setting) => (
|
||||
<MenuItem
|
||||
id="menu-item"
|
||||
key={setting}
|
||||
onClick={() => handleCloseUserMenu(setting)}
|
||||
sx={{ width: "150px" }}
|
||||
>
|
||||
{settings.map((setting) => (
|
||||
<MenuItem
|
||||
id="menu-item"
|
||||
key={setting}
|
||||
onClick={() => handleCloseUserMenu(setting)}
|
||||
sx={{ width: "150px" }}
|
||||
>
|
||||
{icons[setting]}
|
||||
<Typography
|
||||
fontSize="var(--env-var-font-size-medium)"
|
||||
textAlign="center"
|
||||
marginLeft="8px"
|
||||
>
|
||||
{setting}
|
||||
</Typography>
|
||||
</MenuItem>
|
||||
))}
|
||||
</Menu>
|
||||
</Box>
|
||||
</Toolbar>
|
||||
</Container>
|
||||
</AppBar>
|
||||
{icons[setting]}
|
||||
<Typography
|
||||
fontSize="var(--env-var-font-size-medium)"
|
||||
textAlign="center"
|
||||
marginLeft="8px"
|
||||
>
|
||||
{setting}
|
||||
</Typography>
|
||||
</MenuItem>
|
||||
))}
|
||||
</Menu>
|
||||
</Toolbar>
|
||||
</AddBorderOnScroll>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
aside .MuiStack-root {
|
||||
cursor: pointer;
|
||||
}
|
||||
aside > svg {
|
||||
margin: var(--env-var-spacing-2) var(--env-var-spacing-1);
|
||||
}
|
||||
aside .selected-path,
|
||||
aside .MuiStack-root:hover {
|
||||
background-color: var(--env-var-color-13);
|
||||
}
|
||||
aside .MuiStack-root svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
aside span.MuiTypography-root {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
color: var(--env-var-color-5);
|
||||
line-height: 1;
|
||||
}
|
||||
aside .MuiStack-root:nth-last-child(2) {
|
||||
margin-top: auto;
|
||||
position: relative;
|
||||
}
|
||||
aside .MuiStack-root:nth-last-child(2):before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
border-top: solid 1px var(--env-var-color-6);
|
||||
}
|
||||
aside .MuiStack-root:last-child {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
import { useLocation, useNavigate } from "react-router";
|
||||
import { useTheme } from "@emotion/react";
|
||||
|
||||
import BWULogo from "../../assets/Images/bwl-logo.svg?react";
|
||||
import Support from "../../assets/icons/support.svg?react";
|
||||
import StatusPages from "../../assets/icons/status-pages.svg?react";
|
||||
import Maintenance from "../../assets/icons/maintenance.svg?react";
|
||||
import Monitors from "../../assets/icons/monitors.svg?react";
|
||||
import Incidents from "../../assets/icons/incidents.svg?react";
|
||||
import Integrations from "../../assets/icons/integrations.svg?react";
|
||||
import PageSpeed from "../../assets/icons/page-speed.svg?react";
|
||||
import Settings from "../../assets/icons/settings.svg?react";
|
||||
|
||||
import "./index.css";
|
||||
|
||||
/**
|
||||
* @component
|
||||
* Sidebar component serves as a sidebar containing a menu.
|
||||
*
|
||||
* @returns {JSX.Element} The JSX element representing the Sidebar component.
|
||||
*/
|
||||
|
||||
const menu = [
|
||||
{ name: "Monitors", path: "monitors", icon: <Monitors /> },
|
||||
{ name: "Incidents", path: "incidents", icon: <Incidents /> },
|
||||
{ name: "Status pages", path: "status", icon: <StatusPages /> },
|
||||
{ name: "Integrations", path: "integrations", icon: <Integrations /> },
|
||||
{ name: "Maintenance", path: "maintenance", icon: <Maintenance /> },
|
||||
{ name: "Page speed", path: "page-speed", icon: <PageSpeed /> },
|
||||
{ name: "Support", path: "support", icon: <Support /> },
|
||||
{ name: "Settings", path: "settings", icon: <Settings /> },
|
||||
];
|
||||
|
||||
function Sidebar() {
|
||||
const theme = useTheme();
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
return (
|
||||
<Stack component="aside" gap={theme.gap.xs}>
|
||||
<BWULogo alt="BlueWave Uptime Logo" />
|
||||
{menu.map((item) => (
|
||||
<Stack
|
||||
className={
|
||||
location.pathname.includes(item.path) ? "selected-path" : ""
|
||||
}
|
||||
key={item.path}
|
||||
direction="row"
|
||||
alignItems="center"
|
||||
gap={theme.gap.small}
|
||||
borderRadius={`${theme.shape.borderRadius}px`}
|
||||
onClick={() => navigate(`/${item.path}`)}
|
||||
sx={{ p: `${theme.gap.small} ${theme.gap.medium}` }}
|
||||
>
|
||||
{item.icon}
|
||||
<Typography component="span">{item.name}</Typography>
|
||||
</Stack>
|
||||
))}
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
export default Sidebar;
|
||||
Reference in new issue
Block a user