Skip to content

Commit

Permalink
Fix menu items highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Sep 10, 2021
1 parent 06b1a1a commit dc0ec32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 2 additions & 4 deletions ui/src/layout/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useStyles = makeStyles((theme) => ({
}),
},
open: {
width: 200,
width: 240,
},
closed: {
width: 55,
Expand All @@ -44,7 +44,7 @@ const translatedResourceName = (resource, translate) =>
: inflection.humanize(inflection.pluralize(resource.name)),
})

const Menu = ({ onMenuClick, dense }) => {
const Menu = ({ dense = false }) => {
const open = useSelector((state) => state.admin.ui.sidebarOpen)
const translate = useTranslate()
const classes = useStyles()
Expand All @@ -68,7 +68,6 @@ const Menu = ({ onMenuClick, dense }) => {
activeClassName={classes.active}
primaryText={translatedResourceName(resource, translate)}
leftIcon={resource.icon || <ViewListIcon />}
onClick={onMenuClick}
sidebarIsOpen={open}
dense={dense}
/>
Expand All @@ -93,7 +92,6 @@ const Menu = ({ onMenuClick, dense }) => {
activeClassName={classes.active}
primaryText={name}
leftIcon={al.icon || <ViewListIcon />}
onClick={onMenuClick}
sidebarIsOpen={open}
dense={dense}
exact
Expand Down
12 changes: 8 additions & 4 deletions ui/src/layout/SubMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ const useStyles = makeStyles(
(theme) => ({
icon: { minWidth: theme.spacing(5) },
sidebarIsOpen: {
paddingLeft: 25,
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms',
'& a': {
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms',
paddingLeft: theme.spacing(4),
},
},
sidebarIsClosed: {
paddingLeft: 0,
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms',
'& a': {
transition: 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms',
paddingLeft: theme.spacing(2),
},
},
}),
{
Expand Down

0 comments on commit dc0ec32

Please sign in to comment.