Skip to content

Commit

Permalink
HeaderToolbar - Remove unused onToggleInserter code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo committed Jul 10, 2023
1 parent 6ed81c7 commit 3b4c5c2
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Platform, ScrollView, View } from 'react-native';
/**
* WordPress dependencies
*/
import { useCallback, useRef, useState } from '@wordpress/element';
import { useCallback, useRef } from '@wordpress/element';
import { compose, withPreferredColorScheme } from '@wordpress/compose';
import { withSelect, withDispatch } from '@wordpress/data';
import { withViewportMatch } from '@wordpress/viewport';
Expand Down Expand Up @@ -50,10 +50,6 @@ function HeaderToolbar( {
noContentSelected,
} ) {
const anchorNodeRef = useRef();
const wasNoContentSelected = useRef( noContentSelected );
// eslint-disable-next-line no-unused-vars
const [ isInserterOpen, setIsInserterOpen ] = useState( false );

const containerStyle = getStylesFromColorScheme(
styles[ 'header-toolbar__container' ],
styles[ 'header-toolbar__container--dark' ]
Expand Down Expand Up @@ -152,16 +148,6 @@ function HeaderToolbar( {
</ToolbarGroup>
);

const onToggleInserter = useCallback(
( isOpen ) => {
if ( isOpen ) {
wasNoContentSelected.current = noContentSelected;
}
setIsInserterOpen( isOpen );
},
[ noContentSelected ]
);

/* translators: accessibility text for the editor toolbar */
const toolbarAriaLabel = __( 'Document tools' );

Expand All @@ -183,10 +169,7 @@ function HeaderToolbar( {
styles[ 'header-toolbar__scrollable-content' ]
}
>
<Inserter
disabled={ ! showInserter }
onToggle={ onToggleInserter }
/>
<Inserter disabled={ ! showInserter } />

{ noContentSelected && renderMediaButtons }
{ renderHistoryButtons() }
Expand Down

0 comments on commit 3b4c5c2

Please sign in to comment.