From 3b4c5c2f2406a6879bce9a43f030de4f1eade8e0 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Mon, 10 Jul 2023 17:15:52 +0200 Subject: [PATCH] HeaderToolbar - Remove unused onToggleInserter code --- .../header/header-toolbar/index.native.js | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/packages/edit-post/src/components/header/header-toolbar/index.native.js b/packages/edit-post/src/components/header/header-toolbar/index.native.js index a45f127e1b5060..b04a8612a15f7c 100644 --- a/packages/edit-post/src/components/header/header-toolbar/index.native.js +++ b/packages/edit-post/src/components/header/header-toolbar/index.native.js @@ -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'; @@ -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' ] @@ -152,16 +148,6 @@ function HeaderToolbar( { ); - const onToggleInserter = useCallback( - ( isOpen ) => { - if ( isOpen ) { - wasNoContentSelected.current = noContentSelected; - } - setIsInserterOpen( isOpen ); - }, - [ noContentSelected ] - ); - /* translators: accessibility text for the editor toolbar */ const toolbarAriaLabel = __( 'Document tools' ); @@ -183,10 +169,7 @@ function HeaderToolbar( { styles[ 'header-toolbar__scrollable-content' ] } > - + { noContentSelected && renderMediaButtons } { renderHistoryButtons() }