From bed806a282dc39cfb095c4217c1541ebabff5f90 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Tue, 26 Nov 2024 14:59:14 -0500 Subject: [PATCH] chore(network): don't re-show help indicator for every node --- .../components/Search/SearchResultsCounts.tsx | 6 +++--- .../components/Util/CountsTitleWithHelp.tsx | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/js/components/Search/SearchResultsCounts.tsx b/src/js/components/Search/SearchResultsCounts.tsx index 78279b32..a5e55e2a 100644 --- a/src/js/components/Search/SearchResultsCounts.tsx +++ b/src/js/components/Search/SearchResultsCounts.tsx @@ -59,7 +59,7 @@ const SearchResultsCounts = ({ ].join(' ')} > } + title={} value={ hasInsufficientData ? t(message ?? '') @@ -72,14 +72,14 @@ const SearchResultsCounts = ({ /> } + title={} value={hasInsufficientData || (!uncensoredCounts && !biosampleCount) ? NO_RESULTS_DASHES : biosampleCount} valueStyle={STAT_STYLE} // Slight fixup for alignment of non-Antd icon: prefix={} /> } + title={} value={hasInsufficientData || (!uncensoredCounts && !experimentCount) ? NO_RESULTS_DASHES : experimentCount} valueStyle={STAT_STYLE} prefix={} diff --git a/src/js/components/Util/CountsTitleWithHelp.tsx b/src/js/components/Util/CountsTitleWithHelp.tsx index 54f1a341..e617be9c 100644 --- a/src/js/components/Util/CountsTitleWithHelp.tsx +++ b/src/js/components/Util/CountsTitleWithHelp.tsx @@ -10,26 +10,31 @@ const CountsHelpPopoverText = ({ children }: { children: ReactNode }) => (
{children}
); -const CountsTitleWithHelp = ({ entity }: CountsHelpProps) => { +const CountsTitleWithHelp = ({ entity, showHelp }: CountsHelpProps) => { const t = useTranslationFn(); + showHelp = showHelp ?? true; // If undefined, we should show help by default. + const title = t(`entities.${entity}`, T_PLURAL_COUNT); return ( {title} - {t(`entities.${entity}_help`, { joinArrays: ' ' })}} - > - - + {showHelp && ( + {t(`entities.${entity}_help`, { joinArrays: ' ' })}} + > + + + )} ); }; type CountsHelpProps = { entity: BentoEntity; + showHelp?: boolean; }; export default CountsTitleWithHelp;