Skip to content

Commit

Permalink
remove: UI for aria lable
Browse files Browse the repository at this point in the history
  • Loading branch information
up1512001 committed Nov 13, 2024
1 parent fce85c4 commit 1e79171
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 30 deletions.
5 changes: 1 addition & 4 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,10 +870,7 @@ function Navigation( {
<InspectorControls group="advanced">
{ hasResolvedCanUserUpdateNavigationMenu &&
canUserUpdateNavigationMenu && (
<NavigationMenuNameControl
attributes={ attributes }
setAttributes={ setAttributes }
/>
<NavigationMenuNameControl />
) }
{ hasResolvedCanUserDeleteNavigationMenu &&
canUserDeleteNavigationMenu && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,20 @@ import { TextControl } from '@wordpress/components';
import { useEntityProp } from '@wordpress/core-data';
import { __ } from '@wordpress/i18n';

export default function NavigationMenuNameControl( {
attributes,
setAttributes,
} ) {
export default function NavigationMenuNameControl() {
const [ title, updateTitle ] = useEntityProp(
'postType',
'wp_navigation',
'title'
);

const { ariaLabel } = attributes;

return (
<>
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Menu name' ) }
value={ title }
onChange={ updateTitle }
/>
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Aria label' ) }
value={ ariaLabel }
onChange={ ( newAriaLabel ) => {
setAttributes( {
ariaLabel: newAriaLabel,
} );
} }
/>
</>
<TextControl
__next40pxDefaultSize
__nextHasNoMarginBottom
label={ __( 'Menu name' ) }
value={ title }
onChange={ updateTitle }
/>
);
}

0 comments on commit 1e79171

Please sign in to comment.