Updated layout (#450)

* Updated layout

* Fixed error

* Changed integration background to white
This commit is contained in:
Daniel C authored and GitHub committed 2024-07-26 09:39:18 -07:00
1 parent 0339922db8
commit 40a268ab18
54 files changed
+441 -773

No files matched your search

+35
View File
@@ -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;
}
+64
View File
@@ -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;