diff --git a/packages/components/src/navigation/menu/menu-title.js b/packages/components/src/navigation/menu/menu-title.js index e0d83ae9670815..07b0597a56a1f0 100644 --- a/packages/components/src/navigation/menu/menu-title.js +++ b/packages/components/src/navigation/menu/menu-title.js @@ -8,13 +8,15 @@ import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies */ +import Animate from '../../animate'; import Button from '../../button'; +import TextControl from '../../text-control'; +import { useNavigationMenuContext } from './context'; import { MenuTitleHeadingUI, MenuTitleSearchUI, MenuTitleUI, } from '../styles/navigation-styles'; -import TextControl from '../../text-control'; export default function NavigationMenuTitle( { hasSearch, @@ -23,6 +25,7 @@ export default function NavigationMenuTitle( { title, } ) { const [ isSearching, setIsSearching ] = useState( false ); + const { menu } = useNavigationMenuContext(); if ( ! title ) { return null; @@ -37,11 +40,11 @@ export default function NavigationMenuTitle( { const placeholder = sprintf( __( 'Search in %s' ), title ); return ( - + { ! isSearching && ( { title } @@ -59,22 +62,34 @@ export default function NavigationMenuTitle( { ) } { isSearching && ( - - + + { ( { className: animateClassName } ) => ( +
+ + - setSearch( value ) } - placeholder={ placeholder } - value={ search } - /> + setSearch( value ) } + placeholder={ placeholder } + type="search" + value={ search } + /> - - + + +
+ ) } +
) }
);