Skip to content

Commit

Permalink
Use theme spacing for mini variant with
Browse files Browse the repository at this point in the history
  • Loading branch information
jcardus committed Nov 14, 2024
1 parent 15b0e38 commit 547dafb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/common/components/PageLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const useStyles = makeStyles((theme) => ({
flexDirection: 'column',
},
desktopDrawer: {
width: (props) => (props.miniVariant ? theme.dimensions.miniDrawerWidthDesktop : theme.dimensions.drawerWidthDesktop),
width: (props) => (props.miniVariant ? `calc(${theme.spacing(7)} + 1px)` : theme.dimensions.drawerWidthDesktop),
transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen,
Expand Down Expand Up @@ -81,9 +81,7 @@ const PageLayout = ({ menu, breadcrumbs, children }) => {

const [openDrawer, setOpenDrawer] = useState(false);

const toggleDrawer = () => {
setMiniVariant(!miniVariant);
};
const toggleDrawer = () => setMiniVariant(!miniVariant);

return desktop ? (
<div className={classes.desktopRoot}>
Expand Down
1 change: 0 additions & 1 deletion src/common/theme/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export default {
sidebarWidth: '28%',
sidebarWidthTablet: '52px',
drawerWidthDesktop: '360px',
miniDrawerWidthDesktop: '56px',
drawerWidthTablet: '320px',
drawerHeightPhone: '250px',
filterFormWidth: '160px',
Expand Down

0 comments on commit 547dafb

Please sign in to comment.