Skip to content

Commit 433334a

Browse files
committed
OpenConceptLab/ocl_issues#2211 | fixing search skeleton for first time
1 parent e1bd7f3 commit 433334a

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/components/map-projects/Search.jsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import isEmpty from 'lodash/isEmpty'
1313
import values from 'lodash/values'
1414
import flatten from 'lodash/flatten'
1515
import isNaN from 'lodash/isNaN'
16+
import times from 'lodash/times'
1617

1718
import { highlightTexts } from '../../common/utils';
1819
import SearchResults from '../search/SearchResults';
@@ -124,7 +125,16 @@ const Search = ({searchStr, setSearchStr, onSearch, repo, repoVersion, concepts,
124125
/>
125126
</div>
126127
}
127-
<SearchResults
128+
{
129+
isLoading && results?.total === 0 ?
130+
<div style={{width: openFilters ? '66%' : '100%'}}>
131+
{
132+
times(25, i => (
133+
<Skeleton height={58} key={i} />
134+
))
135+
}
136+
</div> :
137+
<SearchResults
128138
resultsContainerId='search-results'
129139
resultSize='small'
130140
sx={{
@@ -172,6 +182,7 @@ const Search = ({searchStr, setSearchStr, onSearch, repo, repoVersion, concepts,
172182
properties={repoVersion?.meta?.display?.concept_summary_properties}
173183
propertyFilters={repoVersion?.filters}
174184
/>
185+
}
175186
</div>
176187
</div>
177188

0 commit comments

Comments
 (0)