Skip to content

Commit 85a6d26

Browse files
CopilotTechQuery
andcommitted
Use MUI Material Icon from Google CDN and unified Drawer component
Co-authored-by: TechQuery <[email protected]>
1 parent f7b20f7 commit 85a6d26

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

components/User/SessionBox.tsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ import { Component, HTMLAttributes, JSX } from 'react';
1717

1818
import { SessionForm } from './SessionForm';
1919

20-
const MenuIcon = () => (
21-
<svg
22-
xmlns="http://www.w3.org/2000/svg"
23-
viewBox="0 0 24 24"
24-
fill="currentColor"
25-
width="24"
26-
height="24"
27-
>
28-
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
29-
</svg>
30-
);
31-
3220
export type MenuItem = Pick<JSX.IntrinsicElements['a'], 'href' | 'title'>;
3321

3422
export interface SessionBoxProps extends HTMLAttributes<HTMLDivElement>, JWTProps<User> {
@@ -109,36 +97,40 @@ export class SessionBox extends Component<SessionBoxProps> {
10997
aria-label="menu"
11098
onClick={this.toggleMobileMenu}
11199
>
112-
<MenuIcon />
100+
<span className="material-symbols-outlined">menu</span>
113101
</IconButton>
114102
</Box>
115103

116-
{/* Mobile Drawer */}
104+
{/* Mobile Drawer - temporary, closes on click */}
117105
<Drawer
118106
anchor="left"
119107
open={this.mobileMenuOpen}
108+
variant="temporary"
120109
sx={{ display: { xs: 'block', md: 'none' } }}
121110
onClose={this.closeMobileMenu}
122111
>
123112
<Box sx={{ width: 250 }}>{this.renderMenuItems()}</Box>
124113
</Drawer>
125114

126-
{/* Desktop Sidebar */}
127-
<Box
115+
{/* Desktop Drawer - persistent, always open */}
116+
<Drawer
117+
anchor="left"
118+
open={true}
119+
variant="permanent"
128120
sx={{
129121
display: { xs: 'none', md: 'block' },
130-
minWidth: 200,
131-
}}
132-
>
133-
<Box
134-
sx={{
122+
'& .MuiDrawer-paper': {
123+
width: 250,
135124
position: 'sticky',
136125
top: '5rem',
137-
}}
138-
>
139-
{this.renderMenuItems()}
140-
</Box>
141-
</Box>
126+
height: 'calc(100vh - 5rem)',
127+
border: 'none',
128+
boxShadow: 'none',
129+
},
130+
}}
131+
>
132+
{this.renderMenuItems()}
133+
</Drawer>
142134

143135
{/* Main Content */}
144136
<Box

0 commit comments

Comments
 (0)