Skip to content

Commit

Permalink
Widget Editor: Remove the "Top Toolbar" setting on small screens
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Jun 15, 2021
1 parent 72e3920 commit a8ec9c1
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions packages/edit-widgets/src/components/more-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { __, _x } from '@wordpress/i18n';
import { external, moreVertical } from '@wordpress/icons';
import { displayShortcut } from '@wordpress/keycodes';
import { useShortcut } from '@wordpress/keyboard-shortcuts';
import { useViewportMatch } from '@wordpress/compose';

/**
* Internal dependencies
Expand Down Expand Up @@ -43,6 +44,8 @@ export default function MoreMenu() {
}
);

const isLargeViewport = useViewportMatch( 'medium' );

return (
<>
<DropdownMenu
Expand All @@ -55,21 +58,23 @@ export default function MoreMenu() {
>
{ () => (
<>
<MenuGroup label={ _x( 'View', 'noun' ) }>
<FeatureToggle
feature="fixedToolbar"
label={ __( 'Top toolbar' ) }
info={ __(
'Access all block and document tools in a single place'
) }
messageActivated={ __(
'Top toolbar activated'
) }
messageDeactivated={ __(
'Top toolbar deactivated'
) }
/>
</MenuGroup>
{ isLargeViewport && (
<MenuGroup label={ _x( 'View', 'noun' ) }>
<FeatureToggle
feature="fixedToolbar"
label={ __( 'Top toolbar' ) }
info={ __(
'Access all block and document tools in a single place'
) }
messageActivated={ __(
'Top toolbar activated'
) }
messageDeactivated={ __(
'Top toolbar deactivated'
) }
/>
</MenuGroup>
) }
<MenuGroup label={ __( 'Tools' ) }>
<MenuItem
onClick={ () => {
Expand Down

0 comments on commit a8ec9c1

Please sign in to comment.