From 4d9fcdc5bf2e09ae3ad966e157268548376c55b7 Mon Sep 17 00:00:00 2001 From: Hina Shah Date: Tue, 21 May 2024 13:07:38 -0400 Subject: [PATCH] FIX: show concept and variable search buttons even when there are no concepts --- src/components/search/form/form.js | 4 +-- .../search/results/results-header/index.js | 24 ++++++++--------- .../variable-view-layout.js | 26 ++++++++++--------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/components/search/form/form.js b/src/components/search/form/form.js index 7ec79e65..d433d7ca 100644 --- a/src/components/search/form/form.js +++ b/src/components/search/form/form.js @@ -241,7 +241,7 @@ export const SearchForm = ({ type=undefined, ...props }) => { ) } - { totalConcepts ? ( + { { /> - ) : null } + } ) } diff --git a/src/components/search/results/results-header/index.js b/src/components/search/results/results-header/index.js index 2b8a97f3..c5fe8704 100644 --- a/src/components/search/results/results-header/index.js +++ b/src/components/search/results/results-header/index.js @@ -46,19 +46,19 @@ export const ResultsHeader = ({ variables=false, type=FULL, ...props }) => {
{type === FULL && ( - - { variables ? ( - `${ variableStudyResultCount } studies and ${ totalVariableResults } variables` - ) : ( - `${ totalConcepts } concepts` + + { variables ? ( + `${ variableStudyResultCount } studies and ${ totalVariableResults } variables` + ) : ( + `${ totalConcepts } concepts` + ) } + + { !variables && ( + + {/* Just want anchor styling */} + + ) } - - { !variables && ( - - {/* Just want anchor styling */} - - - ) } )}
{ { isLoadingVariableResults ? ( ) : ( - - { error.message ? ( - { error.message } - ) : query && totalVariableResults === 0 ? ( - No results were found for "{ query }" - } /> - // No results found - ) : null } - {totalVariableResults > 0 && } - - + query && ( + + { error.message ? ( + { error.message } + ) : !isLoadingVariableResults && totalVariableResults === 0 ? ( + No results were found for "{ query }" + } /> + // No results found + ) : null } + {totalVariableResults > 0 && } + + + ) ) } )