import React, { memo } from "react"; import { useNavigate } from "react-router-dom"; import Box from "@mui/material/Box"; import Drawer from "@mui/material/Drawer"; import Stack from "@mui/material/Stack"; import { styled } from "@mui/material/styles"; import { useMediaQuery } from "@mui/system"; import { LogoType, NavigationOverrides } from "../../types"; import Branding from "./Branding"; import NavRailRoutes from "./NavRailRoutes"; import User from "./User"; const RAIL_WIDTH = 80; const RAIL_HEIGHT = 80; export interface NavRailProps { navigation: NavigationOverrides; logo?: LogoType; title?: string; subtitle?: string; version?: string; } const StyledDrawer = styled(Drawer)(({ theme }) => ({ "& .MuiDrawer-paper": { backgroundColor: theme.palette.mode === "light" ? theme.palette.primary.main : theme.palette.primary.dark, color: theme.palette.primary.contrastText, }, })); export const NavRail: React.FC = ({ navigation, logo, title, subtitle, version }) => { const navigate = useNavigate(); const navigateHome = () => navigate("/", { replace: true }); const isHorizontal = useMediaQuery("(max-width:640px)"); // Switch layout based on screen size return ( {!isHorizontal && ( // TODO: Actually support horizontal layout )} ); }; export default memo(NavRail);