diff --git a/packages/edit-post/src/components/header/post-title/index.js b/packages/edit-post/src/components/header/post-title/index.js index beca595f828ccf..740e65a9346080 100644 --- a/packages/edit-post/src/components/header/post-title/index.js +++ b/packages/edit-post/src/components/header/post-title/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { useSelect } from '@wordpress/data'; +import { useDispatch, useSelect } from '@wordpress/data'; import { store as editorStore } from '@wordpress/editor'; import { useRef } from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; @@ -11,14 +11,32 @@ import { Dropdown, Button, VisuallyHidden, + TextControl, __experimentalText as Text, } from '@wordpress/components'; /** - * Internal dependencies + * External dependencies */ +import { noop } from 'lodash'; + +const EditPostTitlePanel = ( { entityTitle, onChange = noop } ) => { + return ( +
+ +
+ ); +}; function PostTitle() { + const { editPost } = useDispatch( editorStore ); + const { entityTitle, entityLabel } = useSelect( ( select ) => ( { entityTitle: select( editorStore ).getEditedPostAttribute( @@ -49,7 +67,7 @@ function PostTitle() { > { sprintf( - /* translators: %s: the entity being edited, like "template"*/ + /* translators: %s: the entity being edited, like "post"*/ __( 'Editing %s:' ), entityLabel ) } @@ -87,7 +105,12 @@ function PostTitle() { ) } contentClassName="edit-post-title-actions__info-dropdown" renderContent={ () => ( - { __( 'Nothing here yet.' ) } + + editPost( { title: value } ) + } + /> ) } /> diff --git a/packages/edit-post/src/components/header/post-title/style.scss b/packages/edit-post/src/components/header/post-title/style.scss index d6a1717943365e..7a1e0f33001ae8 100644 --- a/packages/edit-post/src/components/header/post-title/style.scss +++ b/packages/edit-post/src/components/header/post-title/style.scss @@ -55,3 +55,8 @@ padding: 0; min-width: 240px; } + +.edit-post-title-panel { + max-width: 240px; + padding: 16px; +}