From 07a246ad15be0f049988c9914df88d8591d6ba4f Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 4 May 2020 10:47:54 +0100 Subject: [PATCH] no search results term Co-authored-by: Andrew Duthie --- .../src/components/inserter/block-list.js | 4 +--- .../src/components/inserter/block-patterns.js | 2 +- .../src/components/inserter/no-results.js | 16 +++------------- .../src/components/inserter/test/block-list.js | 4 +--- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/packages/block-editor/src/components/inserter/block-list.js b/packages/block-editor/src/components/inserter/block-list.js index 2c7afeb559916..a1aafcd54061d 100644 --- a/packages/block-editor/src/components/inserter/block-list.js +++ b/packages/block-editor/src/components/inserter/block-list.js @@ -289,9 +289,7 @@ function InserterBlockList( { ); } if ( ! hasItems ) { - return ( - - ); + return ; } return null; } } diff --git a/packages/block-editor/src/components/inserter/block-patterns.js b/packages/block-editor/src/components/inserter/block-patterns.js index 8bb7da077260d..d739e5f249fda 100644 --- a/packages/block-editor/src/components/inserter/block-patterns.js +++ b/packages/block-editor/src/components/inserter/block-patterns.js @@ -94,7 +94,7 @@ function BlockPatterns( { patterns, onInsert, filterValue } ) { ) } ) : ( - + ); } diff --git a/packages/block-editor/src/components/inserter/no-results.js b/packages/block-editor/src/components/inserter/no-results.js index 552d9a49fa538..3ca6569dc14ea 100644 --- a/packages/block-editor/src/components/inserter/no-results.js +++ b/packages/block-editor/src/components/inserter/no-results.js @@ -1,27 +1,17 @@ /** * WordPress dependencies */ -import { createInterpolateElement } from '@wordpress/element'; -import { __, sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { Icon, blockDefault } from '@wordpress/icons'; -function InserterNoResults( { filterValue } ) { +function InserterNoResults() { return (
-

- { createInterpolateElement( - sprintf( - /* translators: %s: search term. */ - __( 'Sorry no results found on %s.' ), - filterValue - ), - { strong: } - ) } -

+

{ __( 'No results found.' ) }

); } diff --git a/packages/block-editor/src/components/inserter/test/block-list.js b/packages/block-editor/src/components/inserter/test/block-list.js index e4443004cf32c..c83df96520e09 100644 --- a/packages/block-editor/src/components/inserter/test/block-list.js +++ b/packages/block-editor/src/components/inserter/test/block-list.js @@ -55,9 +55,7 @@ const assertNoResultsMessageToBePresent = ( element ) => { const noResultsMessage = element.querySelector( '.block-editor-inserter__no-results' ); - expect( noResultsMessage.textContent ).toEqual( - 'Sorry no results found on random.' - ); + expect( noResultsMessage.textContent ).toEqual( 'No results found.' ); }; const assertNoResultsMessageNotToBePresent = ( element ) => {