Skip to content

Commit

Permalink
Edit Post: Remove menu toggling on checkbox, radio buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 15, 2019
1 parent 7723b06 commit ca9232a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default compose( [
withDispatch( ( dispatch, ownProps ) => ( {
onToggle() {
dispatch( 'core/edit-post' ).toggleFeature( ownProps.feature );
ownProps.onToggle();
},
} ) ),
withSpokenMessages,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ export default compose( [
mode: select( 'core/edit-post' ).getEditorMode(),
} ) ),
ifCondition( ( { isRichEditingEnabled } ) => isRichEditingEnabled ),
withDispatch( ( dispatch, ownProps ) => ( {
withDispatch( ( dispatch ) => ( {
onSwitch( mode ) {
dispatch( 'core/edit-post' ).switchEditorMode( mode );
ownProps.onSelect( mode );
},
} ) ),
] )( ModeSwitcher );
4 changes: 2 additions & 2 deletions packages/edit-post/src/components/header/more-menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const MoreMenu = () => (
) }
renderContent={ ( { onClose } ) => (
<Fragment>
<WritingMenu onClose={ onClose } />
<ModeSwitcher onSelect={ onClose } />
<WritingMenu />
<ModeSwitcher />
<PluginMoreMenuGroup.Slot fillProps={ { onClose } } />
<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />
<MenuGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ifViewportMatches } from '@wordpress/viewport';
*/
import FeatureToggle from '../feature-toggle';

function WritingMenu( { onClose } ) {
function WritingMenu() {
return (
<MenuGroup
label={ _x( 'View', 'noun' ) }
Expand All @@ -19,23 +19,20 @@ function WritingMenu( { onClose } ) {
feature="fixedToolbar"
label={ __( 'Top Toolbar' ) }
info={ __( 'Access all block and document tools in a single place' ) }
onToggle={ onClose }
messageActivated={ __( 'Top toolbar activated' ) }
messageDeactivated={ __( 'Top toolbar deactivated' ) }
/>
<FeatureToggle
feature="focusMode"
label={ __( 'Spotlight Mode' ) }
info={ __( 'Focus on one block at a time' ) }
onToggle={ onClose }
messageActivated={ __( 'Spotlight mode activated' ) }
messageDeactivated={ __( 'Spotlight mode deactivated' ) }
/>
<FeatureToggle
feature="fullscreenMode"
label={ __( 'Fullscreen Mode' ) }
info={ __( 'Work without distraction' ) }
onToggle={ onClose }
messageActivated={ __( 'Fullscreen mode activated' ) }
messageDeactivated={ __( 'Fullscreen mode deactivated' ) }
/>
Expand Down

0 comments on commit ca9232a

Please sign in to comment.