Skip to content

Commit

Permalink
Revert "drawer tab hovering expansion"
Browse files Browse the repository at this point in the history
This reverts commit ed54670.
  • Loading branch information
TurtIeSocks committed Jan 30, 2023
1 parent ed54670 commit 5ac2a69
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions client/src/components/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default function DrawerIndex({ drawerWidth }: Props) {
const { setStore } = usePersist.getState()

const [tab, setTab] = React.useState(TABS.indexOf(menuItem) || 0)
const [hover, setHover] = React.useState(false)

const toggleDrawer = (event: React.KeyboardEvent | React.MouseEvent) => {
if (
Expand Down Expand Up @@ -86,7 +85,7 @@ export default function DrawerIndex({ drawerWidth }: Props) {
<Drawer
variant="permanent"
open={drawer}
drawerWidth={drawerWidth + (hover ? 55 : 0)}
drawerWidth={drawerWidth}
onClose={toggleDrawer}
>
{drawer ? (
Expand All @@ -103,34 +102,19 @@ export default function DrawerIndex({ drawerWidth }: Props) {
>
<Tabs
orientation="vertical"
variant="scrollable"
value={tab}
onChange={handleChange}
sx={{
borderRight: 1,
borderColor: 'divider',
}}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
sx={{ borderRight: 1, borderColor: 'divider' }}
>
{TABS.map((text, i) => {
const Icon = ICON_MAP[text]

return (
<Tab
key={text}
value={i}
label={hover ? text : ''}
icon={hover ? undefined : <Icon />}
sx={(theme) => ({
p: 0,
m: 0,
fontSize: '0.8rem',
minWidth: hover ? 100 : 45,
transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
})}
icon={<Icon />}
sx={{ p: 0, m: 0, minWidth: 45 }}
/>
)
})}
Expand Down

0 comments on commit 5ac2a69

Please sign in to comment.