diff --git a/src/components/browse/dataset/datasetAccordion/datasetSummary/datasetSamples.tsx b/src/components/browse/dataset/datasetAccordion/datasetSummary/datasetSamples.tsx index 9240188..62327a9 100644 --- a/src/components/browse/dataset/datasetAccordion/datasetSummary/datasetSamples.tsx +++ b/src/components/browse/dataset/datasetAccordion/datasetSummary/datasetSamples.tsx @@ -31,8 +31,8 @@ const DatasetSamples = (props: DataSetSamplesProps) => { {stats.sex.length > 0 ? ( <> (Sex:  - {stats.sex.map((x, idx, arr) => { - const sex = /FEMALE/.test(x.value) ? "Female" : "Male"; + {stats.sex.map((x, idx) => { + const sex = x.value.toLowerCase(); return ( {`${idx ? ", " : ""} ${x.count} ${sex}`} diff --git a/src/components/home/homeMidSection/homeMidSection.tsx b/src/components/home/homeMidSection/homeMidSection.tsx index bc82e63..4bff0bc 100644 --- a/src/components/home/homeMidSection/homeMidSection.tsx +++ b/src/components/home/homeMidSection/homeMidSection.tsx @@ -104,16 +104,20 @@ const HomeMidSection = () => { badgeDark: true, }); - const protocolTypes = - summary?.resource_stats?.ExperimentMethod?.stats?.instrument_model || []; + const experimentMethods = summary?.resource_stats?.ExperimentMethod; + const protocolTypes = experimentMethods?.stats?.instrument_model || []; Badges.push({ badgeTitle: BadgeTitleGen(faDna, "Platforms: " + protocolTypes.length), - badgeBody: protocolTypes.map((x: any) => ( - - {x.value}: - {x.count} - - )), + badgeBody: ( + + {protocolTypes.map((x) => ( + + + + + ))} +
{x.count}{x.value}
+ ), bodyColClasses: "pt-3 fs-7 align-items-center", }); @@ -122,15 +126,16 @@ const HomeMidSection = () => { const individualSexes = individuals?.stats?.sex || []; Badges.push({ badgeTitle: BadgeTitleGen(faUser, "Individuals: " + numIndividuals, true), - badgeBody: individualSexes.map((x, i) => { - const sex = /FEMALE/.test(x.value) ? "Female" : "Male"; - return ( - - {sex}: - {x.count} - - ); - }), + badgeBody: ( + + {individualSexes.map((x) => ( + + + + + ))} +
{x.count}{x.value.toLowerCase()}
+ ), badgeDark: true, bodyColClasses: "pt-3 fs-7 align-items-center", }); @@ -138,12 +143,16 @@ const HomeMidSection = () => { const fileStats = aggregateFileStats(summary); Badges.push({ badgeTitle: BadgeTitleGen(faChartColumn, "Files: " + fileStats.count), - badgeBody: fileStats.stats.format.map((x) => ( - - {x.value}: - {x.count} - - )), + badgeBody: ( + + {fileStats.stats.format.map((x) => ( + + + + + ))} +
{x.count}{x.value}
+ ), bodyColClasses: "pt-3 fs-7 align-items-center", }); }