Skip to content

Commit e2196cf

Browse files
committed
main addapts to drawer
1 parent 07edc4b commit e2196cf

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/components/Layout/Layout.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,16 @@ class Layout extends React.PureComponent {
7171
// use classes insted of overrideClasses as material-ui
7272
const classes = { ...defaultClasses, ...overrideClasses };
7373

74+
const mainShift = drawerOpen && (drawerType === 'permanent' || drawerType === 'persistent');
7475
const mainClassnames = classNames(
7576
classes.main,
7677
{ [`${classes.mainFixedAppBar}`]: appBarPosition === 'fixed' },
7778
{ [`${classes.mainStickyFooter}`]: stickyFooter },
79+
{ [`${classes.mainShift}`]: mainShift },
7880
);
7981

8082
const appBarShift =
8183
drawerOpen && !drawerUnder && (drawerType === 'permanent' || drawerType === 'persistent');
82-
console.log('appBarShift', appBarShift);
8384

8485
const appBarClassnames = classNames(classes.appBar, {
8586
[`${classes.appBarShift}`]: appBarShift,

src/components/Layout/styles.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ const styles = theme => ({
3030
mainStickyFooter: {
3131
flex: 1,
3232
},
33-
'@media (max-width: 599px)': {
33+
mainShift: {
34+
marginLeft: drawerWidth,
35+
width: `calc(100% - ${drawerWidth}px)`,
36+
transition: theme.transitions.create('margin', {
37+
easing: theme.transitions.easing.easeOut,
38+
duration: theme.transitions.duration.enteringScreen,
39+
}),
40+
},
41+
'@media (max-width: 599px)': { // use mixim
3442
mainFixedAppBar: {
3543
marginTop: '56px',
3644
},

0 commit comments

Comments
 (0)