feat: show drawer collapsed

This commit is contained in:
Rodolfo Ruiz
2025-08-12 17:31:48 -06:00
parent 4ac86a9097
commit 6300421693

View File

@@ -122,8 +122,10 @@ export default function MenuDrawer({ zone = 'public', open, onClose, onSelect })
{/* Collapsed */} {/* Collapsed */}
{collapsed && ( {collapsed && (
<Box textAlign="center" p={3} alignItems="center" minHeight={112}> <Box textAlign="center" p={3} minHeight={112} justifyContent="center" display="flex"
alignItems="start">
<img <img
style={{ marginTop: 5 }}
src="MiniLogo.png" src="MiniLogo.png"
alt="Dream Views" alt="Dream Views"
/> />
@@ -131,7 +133,13 @@ export default function MenuDrawer({ zone = 'public', open, onClose, onSelect })
)} )}
{/* Items */} {/* Items */}
<List sx={{ width: '100%', py: 0 }}> <List sx={{
width: '100%',
py: 0,
display: 'flex',
flexDirection: 'column',
alignItems: 'stretch'
}}>
{items.map(({ text, icon }, index) => { {items.map(({ text, icon }, index) => {
// Default items // Default items
return ( return (
@@ -151,17 +159,17 @@ export default function MenuDrawer({ zone = 'public', open, onClose, onSelect })
} }
}} }}
sx={{ sx={{
px: collapsed ? 1 : 2, px: collapsed ? 0 : 2,
minHeight: 44, minHeight: collapsed ? 48 : 44,
cursor: 'pointer', cursor: 'pointer',
justifyContent: collapsed ? 'center' : 'flex-start', justifyContent: collapsed ? 'center' : 'flex-start',
width: collapsed ? 50 : '100%', width: '100%',
}} }}
> >
<ListItemIcon <ListItemIcon
sx={{ sx={{
color: '#40120EFF', color: '#40120EFF',
minWidth: 0, minWidth: collapsed ? 'auto' : 40,
mr: collapsed ? 0 : 1.5, mr: collapsed ? 0 : 1.5,
justifyContent: 'center', justifyContent: 'center',
}} }}
@@ -203,7 +211,7 @@ export default function MenuDrawer({ zone = 'public', open, onClose, onSelect })
borderColor: 'transparent' borderColor: 'transparent'
}, },
borderRadius: 0, borderRadius: 0,
marginLeft: 1, marginLeft: 2,
width: 40, width: 40,
height: 40, height: 40,
}}> }}>