Skip to content

Commit

Permalink
Use rich text for editing search result placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
PatelUtkarsh committed Feb 3, 2022
1 parent fbe3c43 commit c6cfe96
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions theme/assets/src/block-editor/blocks/search-header-title/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ import classnames from 'classnames';
import {
AlignmentControl,
BlockControls,
InspectorControls,
useBlockProps,
RichText,
} from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';
import HeadingLevelDropdown from './heading-level-dropdown';
import { PanelBody, TextControl } from '@wordpress/components';

/**
* Edit.
Expand Down Expand Up @@ -71,19 +70,12 @@ const Edit = ( { attributes: { textAlign, level, title }, setAttributes } ) => {
} }
/>
</BlockControls>
<InspectorControls>
<PanelBody title={ __( 'Link settings' ) }>
<TextControl
label={ __( 'Search title', 'material-design-google' ) }
value={ title }
onChange={ newTitle =>
setAttributes( { title: newTitle } )
}
/>
</PanelBody>
</InspectorControls>
<TagName { ...blockProps }>
{ title }
<RichText
tagName={ 'span' }
onChange={ value => setAttributes( { value } ) }
value={ title }
/>
<span>
{ __( ' search keyword', 'material-design-google' ) }
</span>
Expand Down

0 comments on commit c6cfe96

Please sign in to comment.