Our unique scenario presented some challenges, but through diligent effort, we have found a solution. The key aspect involved applying a transition to the <main>
element and adjusting its margin based on the state of the right toolbar. Refer to the snippet below for further details.
main: {
position: 'relative',
flex: 1,
height: '100%',
overflow: 'hidden',
transition: theme.transitions.create('margin', {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
marginRight: -500,
},
mainRightOpen: {
transition: theme.transitions.create('margin', {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
marginRight: 0,
}
This was then put into action as shown below.
<main
className={`${classes.main}
${this.props.rightToolBarOpen ? classes.mainRightOpen : null}
`}
ref={(mainContent) => { this.mainContent = mainContent; }}
>