Skip to content

Commit 77d34ea

Browse files
committed
Search results | no results found text
1 parent ecd72d9 commit 77d34ea

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/components/map-projects/Search.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import max from 'lodash/max'
1212
import isEmpty from 'lodash/isEmpty'
1313
import values from 'lodash/values'
1414
import flatten from 'lodash/flatten'
15+
import isNaN from 'lodash/isNaN'
1516

1617
import { highlightTexts } from '../../common/utils';
1718
import SearchResults from '../search/SearchResults';
@@ -119,6 +120,8 @@ const Search = ({searchStr, setSearchStr, onSearch, repo, repoVersion, concepts,
119120
resource='concepts'
120121
noSorting
121122
noToolbar
123+
searchedText={searchStr}
124+
noResults={!isLoading && !isNaN(results.page) && results?.results?.length === 0}
122125
isLoading={isLoading}
123126
rowsPerPageOptions={[]}
124127
resultContainerStyle={{height: 'calc(100vh - 630px)', overflow: 'auto'}}

src/components/search/SearchResults.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ const SearchResults = props => {
232232
/>
233233
}
234234
{
235-
props.noResults ?
236-
<NoResults searchedText={props.searchedText} height={props.height} /> :
235+
props.noResults && props.searchedText ?
236+
<NoResults searchedText={props.searchedText} height={props.height || '220px'} /> :
237237
<React.Fragment>
238238
{
239239
isCardDisplay ?

0 commit comments

Comments
 (0)