Skip to content

Commit

Permalink
Smaller breakpoint for the mutually exclusive sidebar closing
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Apr 17, 2020
1 parent 828b44c commit ea6a344
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const interfaceLabels = {
function Layout() {
const [ isInserterOpen, setIsInserterOpen ] = useState( false );
const isMobileViewport = useViewportMatch( 'medium', '<' );
const isHugeViewport = useViewportMatch( 'huge', '>=' );
const isLargeViewport = useViewportMatch( 'large', '>=' );
const {
closePublishSidebar,
openGeneralSidebar,
Expand Down Expand Up @@ -126,15 +126,15 @@ function Layout() {

// Inserter and Sidebars are mutually exclusive
useEffect( () => {
if ( sidebarIsOpened && ! isHugeViewport ) {
if ( sidebarIsOpened && ! isLargeViewport ) {
setIsInserterOpen( false );
}
}, [ sidebarIsOpened, isHugeViewport ] );
}, [ sidebarIsOpened, isLargeViewport ] );
useEffect( () => {
if ( isInserterOpen && ! isHugeViewport ) {
if ( isInserterOpen && ! isLargeViewport ) {
closeGeneralSidebar();
}
}, [ isInserterOpen, isHugeViewport ] );
}, [ isInserterOpen, isLargeViewport ] );

return (
<>
Expand Down

0 comments on commit ea6a344

Please sign in to comment.