Skip to content

Commit

Permalink
Block Toolbar: Do not hide the block toolbar on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Mar 2, 2018
1 parent 7bb2547 commit 5dbf02d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions edit-post/components/header/header-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { compose } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { withViewportMatch } from '@wordpress/viewport';

/**
* WordPress dependencies
Expand All @@ -24,7 +23,7 @@ import {
*/
import './style.scss';

function HeaderToolbar( { hasFixedToolbar, isLargeViewport } ) {
function HeaderToolbar( { hasFixedToolbar } ) {
return (
<NavigableToolbar
className="edit-post-header-toolbar"
Expand All @@ -35,7 +34,7 @@ function HeaderToolbar( { hasFixedToolbar, isLargeViewport } ) {
<EditorHistoryRedo />
<TableOfContents />
<MultiBlocksSwitcher />
{ hasFixedToolbar && isLargeViewport && (
{ hasFixedToolbar && (
<div className="edit-post-header-toolbar__block-toolbar">
<BlockToolbar />
</div>
Expand All @@ -48,5 +47,4 @@ export default compose( [
withSelect( ( select ) => ( {
hasFixedToolbar: select( 'core/edit-post' ).isFeatureActive( 'fixedToolbar' ),
} ) ),
withViewportMatch( { isLargeViewport: 'medium' } ),
] )( HeaderToolbar );
6 changes: 2 additions & 4 deletions edit-post/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ import {
} from '@wordpress/editor';
import { Fragment, compose } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { withViewportMatch } from '@wordpress/viewport';

/**
* Internal dependencies
*/
import './style.scss';
import BlockInspectorButton from './block-inspector-button';

function VisualEditor( { hasFixedToolbar, isLargeViewport } ) {
function VisualEditor( { hasFixedToolbar } ) {
return (
<BlockSelectionClearer className="edit-post-visual-editor">
<EditorGlobalKeyboardShortcuts />
Expand All @@ -29,7 +28,7 @@ function VisualEditor( { hasFixedToolbar, isLargeViewport } ) {
<WritingFlow>
<PostTitle />
<BlockList
showContextualToolbar={ isLargeViewport && ! hasFixedToolbar }
showContextualToolbar={ ! hasFixedToolbar }
renderBlockMenu={ ( { children, onClose } ) => (
<Fragment>
<BlockInspectorButton onClick={ onClose } />
Expand All @@ -46,5 +45,4 @@ export default compose( [
withSelect( ( select ) => ( {
hasFixedToolbar: select( 'core/edit-post' ).isFeatureActive( 'fixedToolbar' ),
} ) ),
withViewportMatch( { isLargeViewport: 'medium' } ),
] )( VisualEditor );

0 comments on commit 5dbf02d

Please sign in to comment.