Skip to content

Commit

Permalink
Remove WrappedNavigationMenuSelector (#46056)
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian authored Nov 25, 2022
1 parent 362a6c4 commit 9a4146f
Showing 1 changed file with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,6 @@ import { __ } from '@wordpress/i18n';
import ManageMenusButton from './manage-menus-button';
import NavigationMenuSelector from './navigation-menu-selector';

const WrappedNavigationMenuSelector = ( {
currentMenuId,
onCreateNew,
createNavigationMenuIsSuccess,
createNavigationMenuIsError,
onSelectClassicMenu,
onSelectNavigationMenu,
} ) => (
<NavigationMenuSelector
currentMenuId={ currentMenuId }
onSelectNavigationMenu={ onSelectNavigationMenu }
onSelectClassicMenu={ onSelectClassicMenu }
onCreateNew={ onCreateNew }
createNavigationMenuIsSuccess={ createNavigationMenuIsSuccess }
createNavigationMenuIsError={ createNavigationMenuIsError }
/* translators: %s: The name of a menu. */
actionLabel={ __( "Switch to '%s'" ) }
/>
);
const MenuInspectorControls = ( {
createNavigationMenuIsSuccess,
createNavigationMenuIsError,
Expand All @@ -53,6 +34,8 @@ const MenuInspectorControls = ( {
const menuControlsSlot = window?.__experimentalEnableBlockInspectorTabs
? 'list'
: undefined;
/* translators: %s: The name of a menu. */
const actionLabel = __( "Switch to '%s'" );

return (
<InspectorControls __experimentalGroup={ menuControlsSlot }>
Expand All @@ -70,7 +53,7 @@ const MenuInspectorControls = ( {
>
{ __( 'Menu' ) }
</Heading>
<WrappedNavigationMenuSelector
<NavigationMenuSelector
currentMenuId={ currentMenuId }
onSelectClassicMenu={ onSelectClassicMenu }
onSelectNavigationMenu={
Expand All @@ -83,6 +66,7 @@ const MenuInspectorControls = ( {
createNavigationMenuIsError={
createNavigationMenuIsError
}
actionLabel={ actionLabel }
/>
</HStack>
{ currentMenuId && isNavigationMenuMissing ? (
Expand All @@ -97,7 +81,7 @@ const MenuInspectorControls = ( {
</>
) : (
<>
<WrappedNavigationMenuSelector
<NavigationMenuSelector
currentMenuId={ currentMenuId }
onSelectClassicMenu={ onSelectClassicMenu }
onSelectNavigationMenu={ onSelectNavigationMenu }
Expand All @@ -108,6 +92,7 @@ const MenuInspectorControls = ( {
createNavigationMenuIsError={
createNavigationMenuIsError
}
actionLabel={ actionLabel }
/>
<ManageMenusButton
disabled={ isManageMenusButtonDisabled }
Expand Down

0 comments on commit 9a4146f

Please sign in to comment.