Skip to content

Commit

Permalink
Help section title adapts to editor context
Browse files Browse the repository at this point in the history
Replace "site" with "post" or "page" base on the current content type.
We may reinstate the term "site" once full-site editing features are
included in the help articles.
  • Loading branch information
dcalhoun committed Aug 17, 2021
1 parent 263e077 commit dd5c7d8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/editor/src/components/editor-help/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
trashFilled,
cogAlt,
} from '@wordpress/icons';
import { useSelect } from '@wordpress/data';
import { store as editorStore } from '@wordpress/editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -55,6 +57,10 @@ const HELP_TOPICS = [
];

function EditorHelpTopics( { close, isVisible, onClose } ) {
const { postType } = useSelect( ( select ) => ( {
postType: select( editorStore ).getEditedPostAttribute( 'type' ),
} ) );

return (
<BottomSheet
isVisible={ isVisible }
Expand All @@ -74,7 +80,11 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
isFullscreen
leftButtonOnPress={ close }
leftButtonText={ __( 'Close' ) }
screen={ __( 'How to edit your site' ) }
screen={
postType === 'page'
? __( 'How to edit your page' )
: __( 'How to edit your post' )
}
/>
<BottomSheetConsumer>
{ ( { listProps } ) => {
Expand Down

0 comments on commit dd5c7d8

Please sign in to comment.