From fdf80b8292f9c1b4787817299ca870cd1f6ca492 Mon Sep 17 00:00:00 2001 From: Jeremy Kahn Date: Sat, 26 Nov 2022 09:49:02 -0600 Subject: [PATCH] feat: improve drawer layout --- src/components/Shell/ShellAppBar.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Shell/ShellAppBar.tsx b/src/components/Shell/ShellAppBar.tsx index 1e54d89..c730251 100644 --- a/src/components/Shell/ShellAppBar.tsx +++ b/src/components/Shell/ShellAppBar.tsx @@ -28,19 +28,21 @@ export const AppBar = styled(MuiAppBar, { ...(isDrawerOpen && { width: `calc(100% - ${drawerWidth}px)`, marginLeft: `${drawerWidth}px`, - transition: theme.transitions.create(['margin', 'width'], { - easing: theme.transitions.easing.easeOut, - duration: theme.transitions.duration.enteringScreen, - }), }), ...(isPeerListOpen && { width: `calc(100% - ${peerListWidth}px)`, marginRight: `${peerListWidth}px`, + }), + ...((isDrawerOpen || isPeerListOpen) && { transition: theme.transitions.create(['margin', 'width'], { easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.enteringScreen, }), }), + ...(isDrawerOpen && + isPeerListOpen && { + width: `calc(100% - ${drawerWidth}px - ${peerListWidth}px)`, + }), })) interface ShellAppBarProps {