From 95a488025bba28068bf6c80d8993ba7a2cb21900 Mon Sep 17 00:00:00 2001 From: Jordy <31940280+ac-jorellanaf@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:18:03 +0200 Subject: [PATCH] Fixed horizontal alignment of home page badges (#233) --- .../home/homeMidSection/homeMidSection.tsx | 55 ++++++------------- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/src/components/home/homeMidSection/homeMidSection.tsx b/src/components/home/homeMidSection/homeMidSection.tsx index b408d45..bc82e63 100644 --- a/src/components/home/homeMidSection/homeMidSection.tsx +++ b/src/components/home/homeMidSection/homeMidSection.tsx @@ -110,11 +110,11 @@ const HomeMidSection = () => { badgeTitle: BadgeTitleGen(faDna, "Platforms: " + protocolTypes.length), badgeBody: protocolTypes.map((x: any) => ( - {x.value}: - {x.count} + {x.value}: + {x.count} )), - bodyRowClasses: "pt-3 fs-7", + bodyColClasses: "pt-3 fs-7 align-items-center", }); const individuals = summary?.resource_stats?.Individual; @@ -122,47 +122,28 @@ 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, i) => { + const sex = /FEMALE/.test(x.value) ? "Female" : "Male"; + return ( + + {sex}: + {x.count} -
- ), + ); + }), badgeDark: true, + bodyColClasses: "pt-3 fs-7 align-items-center", }); const fileStats = aggregateFileStats(summary); Badges.push({ badgeTitle: BadgeTitleGen(faChartColumn, "Files: " + fileStats.count), - badgeBody: ( - - - {fileStats.stats.format.map((x) => { - return ( - - - - - ); - })} - -
- {x.value}: - {x.count}
- ), + badgeBody: fileStats.stats.format.map((x) => ( + + {x.value}: + {x.count} + + )), bodyColClasses: "pt-3 fs-7 align-items-center", }); }