Merge branch 'sidebar_changes' into dev_environment

This commit is contained in:
Carter 2026-06-09 10:06:47 -06:00
commit 51f86188a3

View file

@ -1,20 +1,21 @@
import { ChevronRight, Code, Grain, Memory, People, Person, SyncAlt, TapAndPlay } from "@mui/icons-material";
import { ChevronRight, Code, Grain, HelpOutline, Memory, People, Person, SyncAlt, TapAndPlay } from "@mui/icons-material";
import ChevronLeft from "@mui/icons-material/ChevronLeft";
import {
darken,
Divider,
Grid2 as Grid,
IconButton,
lighten,
List,
ListItemButton,
ListItemIcon,
ListItemText,
SwipeableDrawer,
Theme,
Toolbar,
Tooltip,
useTheme
import {
Box,
darken,
Divider,
Grid2 as Grid,
IconButton,
lighten,
List,
ListItemButton,
ListItemIcon,
ListItemText,
SwipeableDrawer,
Theme,
Toolbar,
Tooltip,
useTheme
} from "@mui/material";
import classNames from "classnames";
import { useMobile, useWidth } from "../hooks/useWidth";
@ -31,6 +32,7 @@ import PlaneIcon from "products/AviationIcons/PlaneIcon";
import AirportMapIcon from "products/AviationIcons/AirportMapIcon";
import JobsiteIcon from "products/Construction/JobSiteIcon";
import { getThemeType } from "theme";
import { openCrispChat } from "chat/CrispChat";
import ObjectHeaterIcon from "products/Construction/ObjectHeaterIcon";
import TasksIcon from "products/Construction/TasksIcon";
import CableIcon from "products/Bindapt/CableIcon";
@ -95,6 +97,7 @@ const useStyles = makeStyles((theme: Theme) => ({
listItem: {
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2),
maxHeight: 40,
[theme.breakpoints.up("md")]: {
paddingLeft: theme.spacing(3),
paddingRight: theme.spacing(3)
@ -529,23 +532,37 @@ export default function SideNavigator(props: Props) {
onClose={onClose}
sx={{ pointerEvents: isMobile&&!open ? "none" : "auto"}}
>
<Toolbar>
<Grid container direction="row" justifyContent={"flex-end"}>
<Grid>
<IconButton
onClick={open ? onClose : onOpen}
aria-label={open ? "Close side menu" : "Open side menu"}
>
{open
? theme.direction === "rtl" ? <ChevronRight /> : <ChevronLeft />
: theme.direction === "rtl" ? <ChevronLeft /> : <ChevronRight />}
</IconButton>
<Box sx={{ display: "flex", flexDirection: "column", height: "100%", overflow: "hidden" }}>
<Toolbar disableGutters sx={{ px: 1 }}>
<Grid container direction="row" justifyContent={"flex-end"}>
<Grid>
<IconButton
onClick={open ? onClose : onOpen}
aria-label={open ? "Close side menu" : "Open side menu"}
>
{open
? theme.direction === "rtl" ? <ChevronRight /> : <ChevronLeft />
: theme.direction === "rtl" ? <ChevronLeft /> : <ChevronRight />}
</IconButton>
</Grid>
</Grid>
</Grid>
</Toolbar>
<Divider />
{/* {isAuthenticated || isOffline() ? authenticatedSideMenu() : unauthenticatedSideMenu()} */}
{isAuthenticated && authenticatedSideMenu()}
</Toolbar>
<Divider />
<Box sx={{ flex: 1, overflowY: "auto", scrollbarWidth: "none", "&::-webkit-scrollbar": { display: "none" } }}>
{isAuthenticated && authenticatedSideMenu()}
</Box>
<Divider sx={{ my: 1 }} />
<List className={classes.list} component="nav">
<Tooltip title="Help" placement="right">
<ListItemButton classes={{ root: classes.listItem }} onClick={() => openCrispChat()}>
<ListItemIcon>
<HelpOutline style={{ color: getThemeType() === "light" ? "black" : undefined }} />
</ListItemIcon>
{open && <ListItemText primary="Help" />}
</ListItemButton>
</Tooltip>
</List>
</Box>
</SwipeableDrawer>
);
}