Skip to content

Commit

Permalink
Add site editor page context to document actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyip committed Sep 16, 2020
1 parent dd5fe25 commit 9e52497
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export default function DocumentActions( { documentTitle } ) {
// item is inactive.
const isTitleActive = ! label?.length || ! isActive;

const { page } = useSelect( ( select ) => {
const { getPage } = select( 'core/edit-site' );
return { page: getPage() };
} );

return (
<div
className={ classnames( 'edit-site-document-actions', {
Expand Down Expand Up @@ -99,6 +104,7 @@ export default function DocumentActions( { documentTitle } ) {
</span>
{ /* TODO: Don't allow input when there is no page context */ }
<input
disabled={ ! page }
placeholder={ 'nice' }
style={ { width: '100%' } }
/>
Expand Down

0 comments on commit 9e52497

Please sign in to comment.