diff --git a/src/App.tsx b/src/App.tsx index 7afbecab..88595b92 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -139,13 +139,15 @@ export default function App() { render={() => ( + titleComponent={(open, pinned) => + !(open && pinned) && ( + + ) } > diff --git a/src/components/Navigation/NavDrawer.tsx b/src/components/Navigation/NavDrawer.tsx index c1d49a11..6c69e8f6 100644 --- a/src/components/Navigation/NavDrawer.tsx +++ b/src/components/Navigation/NavDrawer.tsx @@ -16,6 +16,8 @@ import SettingsIcon from "@mui/icons-material/SettingsOutlined"; import ProjectSettingsIcon from "@mui/icons-material/BuildCircleOutlined"; import UserManagementIcon from "@mui/icons-material/AccountCircleOutlined"; import CloseIcon from "assets/icons/Backburger"; +import PinIcon from "@mui/icons-material/PushPinOutlined"; +import UnpinIcon from "@mui/icons-material/PushPin"; import { APP_BAR_HEIGHT } from "."; import Logo from "assets/Logo"; @@ -31,10 +33,17 @@ export const NAV_DRAWER_WIDTH = 256; export interface INavDrawerProps extends DrawerProps { currentSection?: string; onClose: NonNullable; + pinned: boolean; + setPinned: React.Dispatch>; + canPin: boolean; } export default function NavDrawer({ + open, currentSection, + pinned, + setPinned, + canPin, ...props }: INavDrawerProps) { const { userDoc, userClaims } = useAppContext(); @@ -52,14 +61,45 @@ export default function NavDrawer({ return ( + theme.transitions.create("width", { + easing: pinned + ? theme.transitions.easing.easeOut + : theme.transitions.easing.sharp, + duration: pinned + ? theme.transitions.duration.enteringScreen + : theme.transitions.duration.leavingScreen, + }), + + flexShrink: 0, + + "& .MuiDrawer-paper": { + minWidth: NAV_DRAWER_WIDTH, + bgcolor: pinned ? "background.default" : "background.paper", + }, + }} > + + {canPin && ( + setPinned((p) => !p)} + aria-pressed={pinned} + size="large" + style={{ marginLeft: "auto" }} + > + {pinned ? : } + + )}